summaryrefslogtreecommitdiff
path: root/Source/cmMakefileTargetGenerator.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-04 09:51:15 -0400
committerBrad King <brad.king@kitware.com>2020-09-08 15:38:40 -0400
commit45fedf0e176d354b8cb4d3eed4a1ef9bf3943094 (patch)
treebb5ec8205a7f060cec67e7a483bf15811deb8212 /Source/cmMakefileTargetGenerator.h
parent844779bdc1cf124974d946d7a221407dd4d3f693 (diff)
downloadcmake-45fedf0e176d354b8cb4d3eed4a1ef9bf3943094.tar.gz
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/cmMakefileTargetGenerator.h')
-rw-r--r--Source/cmMakefileTargetGenerator.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index b7ec442805..1740d541b8 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -196,6 +196,8 @@ protected:
unsigned long NumberOfProgressActions;
bool NoRuleMessages;
+ bool CMP0113New = false;
+
// the path to the directory the build file is in
std::string TargetBuildDirectory;
std::string TargetBuildDirectoryFull;