diff options
author | Brad King <brad.king@kitware.com> | 2020-09-10 14:56:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-09-14 14:48:16 (GMT) |
commit | b4fc4da903ad5c69cfbf693839ee5020c3f2ede6 (patch) | |
tree | d473e70256a9f5ec5dd34149bf3c1463f6c51de3 /Source/cmPolicies.h | |
parent | f5791e24c63617901ae033c14d99c0e02d402b05 (diff) | |
download | CMake-b4fc4da903ad5c69cfbf693839ee5020c3f2ede6.zip CMake-b4fc4da903ad5c69cfbf693839ee5020c3f2ede6.tar.gz CMake-b4fc4da903ad5c69cfbf693839ee5020c3f2ede6.tar.bz2 |
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
Diffstat (limited to 'Source/cmPolicies.h')
-rw-r--r-- | Source/cmPolicies.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index f9ec0d6..958d061 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -337,7 +337,10 @@ class cmMakefile; SELECT(POLICY, CMP0113, \ "Makefile generators do not repeat custom commands from target " \ "dependencies.", \ - 3, 19, 0, cmPolicies::WARN) + 3, 19, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0114, \ + "ExternalProject step targets fully adopt their steps.", 3, 19, 0, \ + cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ |