Commit Graph

10887 Commits

Author SHA1 Message Date
Brad King
b4fc4da903 ExternalProject: Add policy CMP0114 to refine step target dependencies
`ExternalProject_Add_StepTargets` and `INDEPENDENT_STEP_TARGETS` have
some limitations and lack some sanity checks.  They can cause confusing
build systems to be generated.  The basic problems are:

* The notion of step independence is attached to the step target
  rather than the step itself.

* The custom commands implementing the steps are duplicated in the
  step targets and the primary targets.  This can cause races.
  It is also incompatible with the Xcode "new build system".

Fix this by introducing policy CMP0114 to change the way step target
dependencies are handled.  Define independence from external
dependencies as a property of each individual step regardless of whether
there is a target for it.  Add dependencies among the primary target and
the step targets such that each custom command only appears in one
target.  When some steps are disconnected from the primary target, add
step targets for the steps commonly depended upon so that there is a
place to hold their custom commands uniquely.

Fixes: #18663
2020-09-14 10:48:16 -04:00
Brad King
b637ef494c ExternalProject: Factor out an internal helper to add a step target 2020-09-10 18:14:23 -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
Brad King
8ec7edf563 Merge topic 'ExternalData-doc-typo'
1ad991a13e Help: correct typo in ExternalData (duplicate "of")

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5196
2020-09-08 15:45:41 -04:00
Brad King
d0ccc7cf2a Merge topic 'ispc_improvements'
a020787a9b ISPC: Support generation for multiple instruction sets
5a1750017e ISPC: Add compiler launcher support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5173
2020-09-08 11:19:28 -04:00
Brad King
df226895f5 Merge topic 'FindPython-set-CMP0012-NEW'
0670797d71 FindPython: CMP0012 must be set to NEW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5198
2020-09-08 11:13:49 -04:00
Marc Chevrier
0670797d71 FindPython: CMP0012 must be set to NEW
Fixes: #21168
2020-09-07 18:19:30 +02:00
Joachim Wuttke (o)
1ad991a13e Help: correct typo in ExternalData (duplicate "of") 2020-09-07 14:27:01 +02:00
Cristian Adam
8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header
Fixes: #21163
2020-09-04 19:23:17 +02:00
Robert Maynard
5a1750017e ISPC: Add compiler launcher support 2020-09-03 11:46:11 -04:00
Brad King
7658d5c52d Merge topic 'FindPython-include-dir-ABI-checks'
6fdfe2428d FindPython: enhance ABI checks against include directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5181
2020-09-03 08:46:36 -04:00
Marc Chevrier
6fdfe2428d FindPython: enhance ABI checks against include directory
Fixes: #21149
2020-09-02 15:41:16 +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
2d723e66f1 Merge topic 'cuda_host_compiler_fail'
01428c5560 CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection
9f81aa0f69 CUDA: Fail if compiler detection using the host compiler fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5155
2020-09-01 09:20:23 -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
Brad King
ec0d621e36 Merge topic 'UseSWIG-interface-option'
d264685bee UseSWIG: Update option -interface usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5172
2020-09-01 09:08:06 -04:00
Brad King
fc0dfd41eb Merge topic 'llvm_rc_preprocessing_for_all_windows_clang_variants'
0ccd256787 llvm-rc: Enable preprocessing for all Windows usage variants
7e72fe2ec9 llvm-rc: Refactor the preprocessing logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5163
2020-08-31 12:54:50 -04:00
Marc Chevrier
d264685bee UseSWIG: Update option -interface usage
Option -interface must not be used if multiple SWIG files are part
of the same library.

Fixes: #21134
2020-08-31 12:33:57 +02:00
Raul Tambre
01428c5560 CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection
Also re-ordered the code to avoid testing flags for other compilers, since
we know the vendor before full detection.
2020-08-29 13:06:45 +03:00
Raul Tambre
9f81aa0f69 CUDA: Fail if compiler detection using the host compiler fails
If an user specified a host compiler we should fail if we are unable to perform
compiler detection with it.
Previously we would try without and likely succeed and continue. Then we'd fail
during ABI detection and compiler testing since we'd still try to use it.

This is particularly problematic when crosscompiling since we extract the host
linker from the compiler detection link line. This would result in the wrong
host linker being used and a linking error due to architecture mismatch during
ABI detection where other necessary flags may already be present to make the
host compiler work. See #21076 for an example.

Fix this by adding CMAKE_<LANG>_COMPILER_ID_REQUIRE_SUCCESS to
CMakeDetermineCompilerId, which throws a fatal error if executing the compiler
results in a non-zero exit code.

Fixes #21120.
2020-08-29 13:06:44 +03:00
Robert Maynard
2368f46ba4 ISPC: Support building with the MSVC toolchain 2020-08-28 11:21:31 -04:00
Robert Maynard
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 2020-08-28 11:21:31 -04:00
Robert Maynard
34cc6acc81 Add ISPC compiler support to CMake 2020-08-28 11:21:31 -04:00
Thomas Bernard
0ccd256787 llvm-rc: Enable preprocessing for all Windows usage variants
Fixes: #21096
2020-08-27 12:25:59 -04:00
Thomas Bernard
7e72fe2ec9 llvm-rc: Refactor the preprocessing logic 2020-08-27 12:25:20 -04:00
Brad King
807aaae4ac Merge topic 'FindJNI-arm64' into release-3.18
44dffbcc94 FindJNI: Add arm64 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5162
2020-08-26 10:26:52 -04:00
Brad King
65856616d7 Merge topic 'FindJNI-arm64'
44dffbcc94 FindJNI: Add arm64 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5162
2020-08-26 10:26:52 -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
Malcolm Parsons
44dffbcc94 FindJNI: Add arm64 support
On 64-bit ARM, JVM directories have an arm64 suffix.
2020-08-25 14:34:02 -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
Craig Scott
b972e25276 FetchContent: Fix SOURCE_DIR, BUILD_DIR when disconnected or overridden
Fixes: #21123
2020-08-23 18:38:47 +10:00
Brad King
6cbaa8eb93 Merge topic 'clang-cl-restore-preprocess'
7b083d59c2 clang-cl: Restore rules to create preprocessed and assembly output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5142
2020-08-21 09:31:08 -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
4fc1dd2ff1 Merge topic 'FindMPI-cuda-pthread' into release-3.18
47abe5f225 FindMPI: Fix regression in pthread guard

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5147
2020-08-20 07:55:23 -04:00
Brad King
e029cb1ca6 Merge topic 'FindMPI-cuda-pthread'
47abe5f225 FindMPI: Fix regression in pthread guard

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5147
2020-08-20 07:55:23 -04:00
Axel Huebl
47abe5f225 FindMPI: Fix regression in pthread guard
Fix a regression with MPI and CUDA<10.2 that did let `-pthread` flags
slip to nvcc again.  In commit b725a19072 (FindMPI: Deny -fexceptions
from NVCC, 2020-07-02, v3.18.0-rc4~12^2) we accidentally forgot to use
the variable containing the replacement result.

Fixes: #21108
2020-08-20 06:52:45 -04:00
Brad King
162583bb19 Merge topic 'CMakeDetermineCXXCompiler-clang-typo'
10d7445dd8 clang: Fix the typo for CMAKE_CXX_COMPILER_ID_TEST_FLAGS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5140
2020-08-19 11:51:03 -04:00
Brad King
cb5c8e6f25 Merge topic 'cpack-wix-custom-xmlns'
267de3ba30 CPack/WiX: Add support for custom XML namespaces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5132
2020-08-19 11:48:24 -04:00
Brad King
fed08ce4cf Merge topic 'ExternalProject-retry-only-recoverable'
116b06870d ExternalProject: add INACTIVITY_TIMEOUT argument
f24e34975a ExternalProject: retry download on recoverable errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5034
2020-08-19 11:47:34 -04:00
Brad King
f1ec88708d Merge topic 'CMakeDependentOption-doc'
91f791b498 CMakeDependentOption: Expand documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5138
2020-08-19 11:46:29 -04:00
Brad King
db160604f7 Merge topic 'ep-patch-skip-update-dep'
715324742f ExternalProject: Stop configure target from always appearing out-of-date
c0b7198ad9 ExternalProject: Stop patch target from always appearing out-of-date

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5136
2020-08-19 11:40:03 -04:00
Brad King
281a87f834 Merge topic 'ep-patch-skip-update-dep' into release-3.18
715324742f ExternalProject: Stop configure target from always appearing out-of-date
c0b7198ad9 ExternalProject: Stop patch target from always appearing out-of-date

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5136
2020-08-19 11:40:02 -04:00
Brad King
833e84ca1c Merge topic 'llvm-rc-quote-cmake' into release-3.18
3937536d16 llvm-rc: Fix quoting of path to cmake in CMAKE_RC_COMPILE_OBJECT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5139
2020-08-19 11:37:54 -04:00
Brad King
b5198dacdd Merge topic 'llvm-rc-quote-cmake'
447dfddb20 Merge branch 'backport-3.18-llvm-rc-quote-cmake' into llvm-rc-quote-cmake
3937536d16 llvm-rc: Fix quoting of path to cmake in CMAKE_RC_COMPILE_OBJECT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5139
2020-08-19 11:37:54 -04:00
Brad King
e9d0059bb3 Merge topic 'FindPython-enhance-version-extraction-from-lib-name' into release-3.18
72822e26c9 FindPython: enhance robustness of version extraction from library name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5135
2020-08-19 11:36:51 -04:00
Brad King
705a60902d Merge topic 'FindPython-enhance-version-extraction-from-lib-name'
72822e26c9 FindPython: enhance robustness of version extraction from library name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5135
2020-08-19 11:36:51 -04:00