Commit Graph

686 Commits

Author SHA1 Message Date
Brad King
f200ac1304 Merge topic 'remove-partial-intel-compiler-support'
41b69348a5 Revert "Intel: Add Intel DPC++ compiler identification"
f0babb53b3 Revert "Intel: Add Intel Clang compiler identification"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !5583
2020-12-08 10:16:21 -05:00
Brad King
41b69348a5 Revert "Intel: Add Intel DPC++ compiler identification"
Revert commit 887f3a88a6 (Intel: Add Intel DPC++ compiler
identification, 2020-09-21, v3.19.0-rc1~124^2).  The compiler has
already been released, and is more usable with CMake by pretending to be
upstream Clang than by identifying it as a compiler for which we have
not implemented support.

Fixes: #21551
2020-12-07 10:46:27 -05:00
Brad King
f0babb53b3 Revert "Intel: Add Intel Clang compiler identification"
Revert commit 5c3a93ab88 (Intel: Add Intel Clang compiler
identification, 2020-09-29, v3.19.0-rc1~68^2).  The compiler has already
been released, and is more usable with CMake by pretending to be
upstream Clang than by identifying it as a compiler for which we have
not implemented support.

Issue: #21551
2020-12-07 10:46:22 -05:00
Brad King
628d7ef672 Merge topic 'cuda_env_archs'
c57541d874 CUDA: Fix tests with CUDAARCHS set
c4ae9384ff CUDA: Initialize CMAKE_CUDA_ARCHITECTURES using $ENV{CUDAARCHS}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5533
2020-12-01 09:37:07 -05:00
Raul Tambre
c4ae9384ff CUDA: Initialize CMAKE_CUDA_ARCHITECTURES using $ENV{CUDAARCHS}
NVCC's default architecture may be newer than the one supported by the
machine's GPU.
In such cases it's useful to have an environment variable for initializing
CMAKE_CUDA_ARCHITECTURES to avoid specifying it for every invocation.
2020-11-30 17:57:11 +02:00
Marc Chevrier
2c71d051fa Makefiles Generators: use compiler for dependencies generation
Each source compilation generates a dependencies file. These dependencies
files are consolidated in one file per target. This consolidation is done
as part of command 'cmake -E cmake_depends` launched before evaluation of
makefile dependency graph.

The consolidation uses the same approach as `CMake` dependencies management.

Fixes: #21321
2020-11-29 15:25:42 +01:00
Brad King
4e4ced79fd Merge topic 'ctest_custom_versions'
6e7625989c Help: Fix `.. versionadded` directives for CTEST_CUSTOM_* variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5524
2020-11-23 11:24:22 -05:00
Nikita Nemkin
6e7625989c Help: Fix .. versionadded directives for CTEST_CUSTOM_* variables
CTEST_CUSTOM_* variables predate 3.0, but the docs were only added in 3.4.

Issue: #19715
2020-11-22 03:15:45 +05:00
Brad King
c8b2331e8b Merge topic 'rename_cuda_memcheck'
fea49b2df0 CTest: Rename CudaMemcheck to CudaSanitizer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5514
2020-11-18 07:29:54 -05:00
Tobias Ribizel
fea49b2df0
CTest: Rename CudaMemcheck to CudaSanitizer 2020-11-17 21:06:30 +01:00
Brad King
9450ab0d23 Merge topic 'envvar_versions'
5934a6275c Help: Fix `.. versionadded` directives in environment variable docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5498
2020-11-11 15:22:26 -05:00
Nikita Nemkin
5934a6275c Help: Fix .. versionadded directives in environment variable docs
Many environment variables were documented late and got
assigned wrong versions by the script.
(The whole Help/envvar section was only added in 3.10).

Issue: #19715
2020-11-11 20:38:18 +05:00
Brad King
ffda92d4bf Merge topic 'clang-tidy-for-objc'
1134064e22 clang-tidy: allow OBJC and OBJCXX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5467
2020-11-06 08:05:00 -05:00
Craig Scott
9201b3fa40 Merge topic 'help_ctest_cuda_memcheck'
e620bb7293 Help: Add cuda-memcheck to CTest documentation
fb98883e2b CTest: Add cuda-memcheck to Dart and CTest module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5469
2020-11-06 05:50:53 -05:00
Andrew Fuller
1134064e22 clang-tidy: allow OBJC and OBJCXX 2020-11-05 11:39:32 -08:00
Tobias Ribizel
e620bb7293 Help: Add cuda-memcheck to CTest documentation
Issue: #21388
2020-11-05 10:05:01 -05:00
Brad King
a9e2b18bf3 Merge topic 'android-stl'
4dca078829 Android: Link c++abi and android_support when necessary
738caa4d48 Android: Add options to control exceptions/rtti

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5444
2020-11-05 07:55:46 -05:00
Haibo Huang
738caa4d48 Android: Add options to control exceptions/rtti
With the NDK's `android.toolchain.cmake`, the user can control whether
exceptions/rtti is enabled using `ANDROID_CPP_FEATURES`:

  43b2de34ef/build/cmake/android.toolchain.cmake (548)

Add `CMAKE_ANDROID_RTTI` and `CMAKE_ANDROID_EXCEPTIONS` to support that.
2020-11-04 14:18:03 -05:00
Brad King
f511a1c009 CMakeDetermineCompilerABI: Detect byte order as part of check
We already detect `sizeof(void*)`.  Detect the byte order as part of the
same check.

Issue: #21392
2020-11-04 10:08:13 -05:00
Christopher Tetreault
fb95d02252 Help: Document case insensitivity for CMAKE_BUILD_TYPE
The value of CMAKE_BUILD_TYPE is case insensitive. Furthermore, the
actual value of the variable will have the same casing as the user
specifies on the command line.
2020-10-23 09:19:29 -04:00
Kyle Edwards
146e1e6ba1 Ninja: Transform DEPFILEs with policy CMP0116
Fixes: #21267
2020-10-13 10:19:46 -04:00
Brad King
e1ab55b4ca Help: Update Sphinx versionadded directives for 3.19 release
Run the script:

    Utilities/Sphinx/update_versions.py --since v3.18.0 --overwrite
2020-10-08 09:30:26 -04:00
Brad King
436b57ccb2 Merge topic 'genexpr-for-mfc-flag'
c1f1eaf7a4 VS: Teach CMAKE_MFC_FLAG to support generator expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5283
2020-10-01 07:59:33 -04:00
Brad King
9fc742041b Merge topic 'intel-clang'
5c3a93ab88 Intel: Add Intel Clang compiler identification

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5300
2020-10-01 07:55:13 -04:00
Andrey Starodubtsev
c1f1eaf7a4 VS: Teach CMAKE_MFC_FLAG to support generator expressions 2020-09-30 12:24:13 -04:00
Brad King
e8b0359a43 cmake_language: Add signature to DEFER calls to later times
Fixes: #19575
2020-09-29 17:12:33 -04:00
Harini Chilamantula
5c3a93ab88 Intel: Add Intel Clang compiler identification
The compiler identifies itself with the `__INTEL_CLANG_COMPILER`
preprocessor definition.
2020-09-29 17:00:43 -04:00
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
Brad King
8d5f4c4db9 Xcode: Switch to the "new build system" for Xcode 12 and above
Provide an option to switch back to the original build system via
`-T buildsystem=1`.

Fixes: #18088
2020-09-18 13:02:14 -04:00
Brad King
2db623f554 Xcode: Add option to specify build system variant
Extend the `-T <toolset>` option to support a `buildsystem=` field with
the Xcode generator.  Add a `CMAKE_XCODE_BUILD_SYSTEM` variable to
inform project code about the selected build system variant.
2020-09-18 12:49:17 -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
Robert Maynard
a020787a9b ISPC: Support generation for multiple instruction sets 2020-09-04 08:37:07 -04:00
Robert Maynard
5a1750017e ISPC: Add compiler launcher support 2020-09-03 11:46:11 -04: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
Brad King
8f73ff0c37 Merge topic 'target_genex_dependency'
f14b390198 GenEx: Remove unneeded dependencies from target info queries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5127
2020-09-01 09:59:08 -04:00
Craig Scott
3001e8b5d9 Merge topic 'xcode-link-phase-all'
525464ed2a Xcode: Use "Link Binary With Libraries" build phase in some cases
dc0898205c Xcode: Add special case for file type extension map for .xcassets
7b3d8411a2 Xcode: Refactor build setting append code and attribute getter naming

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5036
2020-09-01 09:38:05 -04:00
Robert Maynard
f14b390198 GenEx: Remove unneeded dependencies from target info queries
Only generate a graph dependency between a custom command and
a target when the custom command queries for the file path
of an artifact of the target.

This makes generator expressions such as `TARGET_FILE_DIR`
behave the same way as `TARGET_PROPERTY` which never generated
a graph dependency.
2020-09-01 09:25:19 -04: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
Gusts Kaksis
525464ed2a Xcode: Use "Link Binary With Libraries" build phase in some cases
OBJECT and STATIC libraries (framework or non-framework) do not use
this build phase. Not all items to be linked use this build phase either.

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2020-09-01 07:38:48 +10:00
Raul Tambre
a57beabb78 Help: Reference CMAKE_CUDA_COMPILER_ID not CMAKE_CUDA_COMPILER
We should refer to the compiler ID in the documentation to avoid users checking
compiler executable names, since that seems fragile.
2020-08-29 13:26:25 +03:00
Robert Maynard
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 2020-08-28 11:21:31 -04:00
jonathan molinatto
ba497111f6 VS: Add option for custom Win10 SDK version maximum
Since commit 83ddc4d289 (VS: Do not select a Windows SDK too high for
current VS version, 2017-08-07, v3.13.0-rc1~72^2~2) we enforce a maximum
SDK version for the VS 2015 generator.  The blog post linked in the
original commit is no longer available, but it can be seen here:

* https://web.archive.org/web/20190108032520/https://blogs.msdn.microsoft.com/chuckw/2018/10/02/windows-10-october-2018-update/

In particular, it states:

> VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763)
> is officially only supported for VS 2017.

However, in some circumstances a higher version can be used.

Add a `CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` to override the
generator's default maximum SDK version.

Fixes: #20633
2020-08-25 15:27:38 -04:00
Kyle Edwards
2e42651dff Add option to optimize link dependencies for static libraries
Add an `OPTIMIZE_DEPENDENCIES` target property and supporting
`CMAKE_OPTIMIZE_DEPENDENCIES` variable to optionally enable pruning and
flattening of outgoing dependencies from static libraries.  Since they
do not actually link, they only depend on side effects of their
dependencies.  Therefore we can drop dependencies that contribute no
side effects.
2020-08-12 11:31:07 -04:00
Brad King
121c3717ee Merge topic 'automoc-path-prefix-off'
5b5be34811 Help: Add 3.18.2 release note about AUTOMOC_PATH_PREFIX default change
db659e18bc Merge branch 'backport-3.17-automoc-path-prefix-off'
e503fbe38a Merge branch 'backport-3.16-automoc-path-prefix-off'
4c33b305a0 Autogen: Turn off moc path prefix generation by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5105
2020-08-11 08:51:02 -04:00
Brad King
0953c0051e Merge topic 'clang-cl-vfs'
20ebaed972 Clang: Add support for passing VFS arguments
d993ebd4ca clang-cl: Add '--' before source file
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5087
2020-08-10 11:33:19 -04:00
Brad King
db659e18bc Merge branch 'backport-3.17-automoc-path-prefix-off' 2020-08-10 10:49:18 -04:00
Brad King
e503fbe38a Merge branch 'backport-3.16-automoc-path-prefix-off' 2020-08-10 10:41:06 -04:00
Joerg Bornemann
4c33b305a0 Autogen: Turn off moc path prefix generation by default
Change the default value of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF` to
restore compatibility with behavior of CMake 3.15 and below.

C++ source files that are generated by Qt's meta object compiler (moc)
include the header file that was passed as input argument to moc. This
is usually a path relative to the source directory, for example

    #include "../../source/dir/myobject.h"

That is problematic for reproducible builds as described in #18815.
To cope with that, the target property AUTOMOC_PATH_PREFIX was
introduced in CMake 3.16 by commit d018d27c10 (Autogen: Add moc path
prefix generation (AUTOMOC_PATH_PREFIX), 2019-09-13, v3.16.0-rc1~94^2~4).
The property is default-initialized from the variable
`CMAKE_AUTOMOC_PATH_PREFIX`, which defaults to `ON`.

If this property is ON, and myobject.h is located in an include
directory of the target, moc-generated C++ files include the file
without the "path prefix":

    #include "myobject.h"

This behavior, however, can break projects that have equally named
header files in different include directories.  As "not breaking
existing projects" trumps "have reproducible builds by default" we
change the default of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF`.

Also, it is now possible to pass `-DCMAKE_AUTOMOC_PATH_PREFIX=ON` on the
CMake command line.  Before, it was overridden in `CMakeGenericSystem`.

Fixes: #20598
Issue: #18815
2020-08-10 10:36:17 -04:00
Thomas Bernard
20ebaed972 Clang: Add support for passing VFS arguments 2020-08-07 11:52:45 -04:00
Fred Baksik
db486da265 Toolchain: Update documentation for initial compiler flags 2020-08-03 12:34:46 -04:00