Commit Graph

663 Commits

Author SHA1 Message Date
Harini Chilamantula
887f3a88a6 Intel: Add Intel DPC++ compiler identification
The compiler identifies itself with the `__INTEL_DPCPP_COMPILER__`
preprocessor definition.
2020-09-22 15:20:03 -04:00
Josef Angstenberger
6a66bb13ed Compiler/TI: Add std options for C++14
The TI compiler does either support C++98 or C++14,
but not both at the same time.
2020-09-21 00:57:20 +02:00
Josef Angstenberger
fe9cddf181 Compiler/TI: Add std options for C++98
The TI compiler does not support C++98, only C++03
(based on manual of current version).

This change sets the C++98 option to C++03 based on the fact that it
is done this way for the SunPro compiler already.
2020-09-21 00:57:20 +02:00
Josef Angstenberger
55fc045aa8 Compiler/TI: Add std options for C11 2020-09-21 00:57:20 +02:00
Josef Angstenberger
2e69993101 Compiler/TI: Check default C standard 2020-09-21 00:57:19 +02:00
Josef Angstenberger
8300030f71 Compiler/TI: Check compiler version for C99 support 2020-09-21 00:57:19 +02:00
Josef Angstenberger
0b4582f229 Compiler/TI: Fix definition of std options
- The compile option variable has to be defined as list.

- The compiler works in relaxed ANSI mode by default.
  Strict ANSI has to be explicitly set additionally to the
  language standard.
2020-09-21 00:57:18 +02:00
Josef Angstenberger
a70df0d6f0 Compiler/TI: Avoid generic variable name in macro
In commit a548a52230 (Compiler/TI: Refactor C/CXX to use a common file,
2020-07-11) a variable named `prefix` has been introduced.

It is set in the callers namespace because it was defined inside a
macro, not a function.

Avoid such generic variable name.
2020-09-21 00:57:18 +02:00
Andrew Fuller
bb61c2d024 Clang: use -imsvc for system include dirs when running on Windows
Fixes #17808
2020-09-16 10:06:46 -07:00
Brad King
8924b60f8d Merge topic 'armclang-fixes'
3d1ed986e2 ARMClang: Fix link line generation after addition of armlink support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Osama Moharam <osama.moharam.uw@renesas.com>
Merge-request: !5211
2020-09-11 08:30:33 -04:00
Marc Chevrier
3d1ed986e2 ARMClang: Fix link line generation after addition of armlink support
Revise logic added by commit 73fb6ac82b (ARMClang: Add support for
armlink, 2020-06-02, v3.18.0-rc1~27^2).

Fixes: #21154
2020-09-10 16:33:14 -04:00
Brad King
48ed3bae58 Merge topic 'pch-instantiate-templates'
8c8f03422e PCH: Template instantiation support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5168
2020-09-10 16:32:39 -04:00
Brad King
6d77487eb7 Merge topic 'ios-pch-x-lang-header'
8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5188
2020-09-09 11:23:34 -04:00
Cristian Adam
8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header
Fixes: #21163
2020-09-04 19:23:17 +02:00
Tobias Hieta
8c8f03422e PCH: Template instantiation support
Adds PCH_INSTANTIATE_TEMPLATES target property for enabling template
instantiation in precompiled headers.
Enabled by default. Currently only supported for Clang 11 and newer.

Implements #21133.
2020-09-02 08:30:55 +02:00
Hugues Kamba
fa7ba5fbf5 ARMClang: Pass defines to assembler
This is useful when the assembly file(s) is passed to
the pre-processor.
2020-09-01 18:03:49 +01:00
Brad King
f10682b796 Merge topic 'ispc_lang_support'
5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image
8976817d6d ISPC: Update help documentation to include ISPC
2368f46ba4 ISPC: Support building with the MSVC toolchain
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds
34cc6acc81 Add ISPC compiler support to CMake
419d70d490 Refactor some swift only logic to be re-used by other languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5065
2020-09-01 09:15:39 -04:00
Robert Maynard
34cc6acc81 Add ISPC compiler support to CMake 2020-08-28 11:21:31 -04:00
Brad King
57c1be6e15 Merge topic 'cuda-std-for-msvc' into release-3.18
bed315a0da CUDA: Support setting CUDA14/17 when using MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5160
2020-08-26 10:25:44 -04:00
Brad King
bf0262f41e Merge topic 'cuda-std-for-msvc'
bed315a0da CUDA: Support setting CUDA14/17 when using MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5160
2020-08-26 10:25:44 -04:00
Brad King
4294526504 Merge topic 'msvc_static_assert'
95bc11dbb4 MSVC: Record support for c_static_assert

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5148
2020-08-25 10:26:54 -04:00
Robert Maynard
bed315a0da CUDA: Support setting CUDA14/17 when using MSVC
Fixes #20953
2020-08-24 09:53:38 -04:00
Raul Tambre
95bc11dbb4 MSVC: Record support for c_static_assert
Supported since MSVC 19.28.29115 (VS 16.8.0 Preview 1.0).
2020-08-20 09:45:47 -04:00
Brad King
b3196fe864 Merge topic 'msvc_c11'
f7347f28c7 MSVC: Record support for C11 and c_restrict

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5115
2020-08-12 11:14:52 -04:00
Raul Tambre
f7347f28c7 MSVC: Record support for C11 and c_restrict
MSVC >=19.27 supports a C11 switch.
The `c_restrict` feature has also been implemented.

Fixes: #21069
2020-08-11 09:08:21 -04:00
Brad King
3d27b17347 Merge topic 'clang-msvc-cxx-std'
21e497fe63 Clang: Fix fallback compile features when simulating old MSVC versions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5082
2020-07-30 08:39:58 -04:00
Brad King
21e497fe63 Clang: Fix fallback compile features when simulating old MSVC versions
Refactoring in commit 25439c7d62 (Clang: Refactor CXX standard flags
into __compiler_clang_cxx_standards(), 2020-03-16, v3.18.0-rc1~362^2~4)
accidentally broke the `cxx_std_*` fallback feature names.

Issue: #21033
2020-07-29 13:02:21 -04:00
Brad King
64e5c239d3 Merge topic 'pgi-no-A'
52eee19389 PGI: Remove -A from the C++ flags we use when CXX_EXTENSIONS is OFF

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Chuck Atkins <chuck.atkins@kitware.com>
Merge-request: !5025
2020-07-23 08:29:02 -04:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Tin Huynh
52eee19389 PGI: Remove -A from the C++ flags we use when CXX_EXTENSIONS is OFF
Since commit 9b97cb5562 (PGI: Add language standards for PGI,
2017-05-01, v3.9.0-rc1~174^2), we have passed the `-A` flag to
the PGI C++ compiler when specifying a C++ standard flag with
compiler extensions turned off.  The flag is not meant for that.
The PGI C++ standard flags do not turn extensions on by default
and have a separate `--gnu_extensions` flag for that which we
already use when CXX_EXTENSIONS is ON.  Simply drop the `-A` flag.

Fixes: #20997
2020-07-22 07:26:01 -04:00
Josef Angstenberger
98fea8205e Compiler/TI: Avoid response file usage for linker
The object and library files have to be listed after the `--run-linker`
flag.

But after this flag the `--cmd_file` flag for response files cannot be
used any more.

Putting the whole command line into a response file would work, but
this is not supported by CMake (yet).
2020-07-14 02:41:51 +02:00
Josef Angstenberger
5dec322f33 Compiler/TI: Add compiler flags to linker
By adding the compiler flags via `<FLAGS>` to the linker call,
the linker can decide which default library to use.

CMake replaces `<FLAGS>` by the content of `CMAKE_<LANG>_FLAGS`.
So any relevant flag needs to be defined in this variable, preferably
in a toolchain file.

The compiler flags have to be specified before the `--run_linker`
flag and the linker flags afterwards.

Replaces Merge-request !4890
2020-07-14 02:41:50 +02:00
Josef Angstenberger
763b44e519 Compiler/TI: Avoid usage of ranlib
If a ranlib executable has been found it is used for finishing
an archive.

In case of the TI compiler the archive file gets corrupted.

Fixes: #14876
2020-07-14 02:23:58 +02:00
Josef Angstenberger
ef528f10bf Compiler/TI: Sync ASM settings to C/CXX
For assembler the same compiler executable is used as for C/CXX.

So the setting shall be kept in sync.
2020-07-14 02:23:57 +02:00
Josef Angstenberger
a548a52230 Compiler/TI: Refactor C/CXX to use a common file 2020-07-14 02:23:57 +02:00
Brad King
df8ba4f10d Merge topic 'intel-c++20' into release-3.18
99c8dbf497 Intel: Add flags for C++20

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4946
2020-06-29 08:16:16 -04:00
Brad King
85b151ff5b Merge branch 'backport-intel-c++20' into intel-c++20 2020-06-26 08:24:46 -04:00
Brad King
99c8dbf497 Intel: Add flags for C++20
Patch-by: Matheus Izvekov
Fixes: #20880
2020-06-26 08:21:21 -04:00
Brad King
cadc658e9d Merge topic 'armclang-typo'
2ff68c00e0 ARMClang: Fix typo in -Xlinker flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4916
2020-06-18 09:37:47 -04:00
Osama Moharam
2ff68c00e0 ARMClang: Fix typo in -Xlinker flag
Fix a typo from commit ef816610be (ARMClang: allow fallback to -march
and correct setting of --cpu flags, 2020-06-03, v3.18.0-rc1~18^2).
2020-06-18 07:43:22 -04:00
Brad King
8e61ebb75e Merge topic 'clang_cxx20'
b365385d66 Clang: Record Clang 6.0+ as fully supporting C++17
5d26efe38f Clang: Add final C++20 flag for Clang 11.0+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4887
2020-06-15 09:01:44 -04:00
Raul Tambre
b365385d66 Clang: Record Clang 6.0+ as fully supporting C++17 2020-06-13 11:29:55 +03:00
Raul Tambre
5d26efe38f Clang: Add final C++20 flag for Clang 11.0+
-std=c++20 superseded -std=c++2a in upstream Clang commit
24ad121582454e625bdad125c90d9ac0dae948c8.
2020-06-13 11:29:51 +03:00
Brad King
7925279c20 Merge topic 'add_explicit_lang_flag_to_compile_object_rule'
74b1c9fc8e Explicitly specify language flag when source LANGUAGE property is set
457170a476 CXX: Compile when possible with explicit `Cxx` language flag set
644d3b86eb C: Compile when possible with explicit `C` language flag set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4780
2020-06-11 07:47:30 -04:00
Robert Maynard
95700be52d CUDA: Teach CMake that NVCC 11 supports cuda_std_17 2020-06-10 13:27:51 -04:00
Robert Maynard
457170a476 CXX: Compile when possible with explicit Cxx language flag set
Issue: #14516, #20716
2020-06-09 16:20:53 -04:00
Robert Maynard
644d3b86eb C: Compile when possible with explicit C language flag set
Issue: #14516, #20716
2020-06-09 16:20:53 -04:00
Raul Tambre
0f88b7a592 CUDA: Fix Clang depfile flags when simulating MSVC
__compiler_clang() doesn't call __compiler_gnu() if we're emulating MSVC. Thus
CMAKE_DEPFILE_FLAGS_CUDA remains unset and compiling doesn't work, due to NVCC
dependency injection workaround in CMakeCUDAInformation.cmake, which triggers
for Ninja if they're not set.
Always set the depfile flags to fix this. Most other compiler modules seem to
do the same.
2020-06-08 07:54:51 -04:00
Osama Moharam
ef816610be ARMClang: allow fallback to -march and correct setting of --cpu flags
allows cmake to fall back to CMAKE_SYSTEM_ARCH in case CMAKE_SYSTEM_PROCESSOR is not in armclang -mcpu=list
additionally checks if CMAKE_SYSTEM_PROCESSOR belongs to armlink --cpu=list

Fixes: #19962
2020-06-03 16:58:31 +02:00
Brad King
007109b20f Merge topic 'armclang-armlink'
73fb6ac82b ARMClang: Add support for armlink

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4811
2020-06-03 06:10:14 -04:00