summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-03-03 19:18:37 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-03-03 20:15:13 (GMT)
commit081c4679f7d427aa6d7fd4e9959c7850c169e2c7 (patch)
treebad71b2cfe93712db6142e32523f0b7f1debc521 /Source
parentd1cb554c99c73e1486fbf4e09125337a7c0e9ea3 (diff)
downloadCMake-081c4679f7d427aa6d7fd4e9959c7850c169e2c7.zip
CMake-081c4679f7d427aa6d7fd4e9959c7850c169e2c7.tar.gz
CMake-081c4679f7d427aa6d7fd4e9959c7850c169e2c7.tar.bz2
Ninja Multi-Config: Don't build target dependencies for custom commands
If cross-config mode is used, and a target depends on another target as well as a custom command, we don't want the custom command to also depend on the depended target, as that would build targets unnecessarily. Fix this behavior.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 5243c36..4826a06 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1178,7 +1178,8 @@ void cmGlobalNinjaGenerator::AppendTargetDependsClosure(
cmNinjaOuts this_outs; // this will be the new cache entry
for (auto const& dep_target : this->GetTargetDirectDepends(target)) {
- if (dep_target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (dep_target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
+ (this->EnableCrossConfigBuild() && !dep_target.IsCross())) {
continue;
}