summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-04 13:51:15 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-08 19:38:40 (GMT)
commit45fedf0e176d354b8cb4d3eed4a1ef9bf3943094 (patch)
treebb5ec8205a7f060cec67e7a483bf15811deb8212 /Source/cmPolicies.h
parent844779bdc1cf124974d946d7a221407dd4d3f693 (diff)
downloadCMake-45fedf0e176d354b8cb4d3eed4a1ef9bf3943094.zip
CMake-45fedf0e176d354b8cb4d3eed4a1ef9bf3943094.tar.gz
CMake-45fedf0e176d354b8cb4d3eed4a1ef9bf3943094.tar.bz2
Makefile: Add policy CMP0113 to avoid duplication of custom commands
Do not attach a custom command to a target if it is already attached to one of the target's dependencies. The command's output will be available by the time the target needs it because the dependency containing the command will have already been built. This may break existing projects that do not properly mark non-created outputs with the `SYMBOLIC` property. Previously a chain of two custom commands whose intermediate dependency is not created would put both commands in a dependent project's Makefile even if the first command is also in its dependency's Makefile. The first command would run twice but the build would work. Now the second command needs an explicit `SYMBOLIC` mark on its input to tell CMake that it is not expected to exist. To maintain compatibility with projects that left out the mark, add a policy activating the behavior.
Diffstat (limited to 'Source/cmPolicies.h')
-rw-r--r--Source/cmPolicies.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 5b286d4..f9ec0d6 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -333,6 +333,10 @@ class cmMakefile;
SELECT(POLICY, CMP0112, \
"Target file component generator expressions do not add target " \
"dependencies.", \
+ 3, 19, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0113, \
+ "Makefile generators do not repeat custom commands from target " \
+ "dependencies.", \
3, 19, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
@@ -367,7 +371,8 @@ class cmMakefile;
F(CMP0104) \
F(CMP0105) \
F(CMP0108) \
- F(CMP0112)
+ F(CMP0112) \
+ F(CMP0113)
/** \class cmPolicies
* \brief Handles changes in CMake behavior and policies