summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorEvan Wilde <etceterawilde@gmail.com>2022-11-11 17:59:59 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-17 18:05:22 (GMT)
commit38c8807c5ac5cdc7c8d5f6ff48b521b0a2e3c81c (patch)
treee4556d10953db029979b50e63421dd976d9d8ad9 /Source/cmNinjaNormalTargetGenerator.cxx
parent0c71f3c94388d7f526bb8254c2162d2827fbeca3 (diff)
downloadCMake-38c8807c5ac5cdc7c8d5f6ff48b521b0a2e3c81c.zip
CMake-38c8807c5ac5cdc7c8d5f6ff48b521b0a2e3c81c.tar.gz
CMake-38c8807c5ac5cdc7c8d5f6ff48b521b0a2e3c81c.tar.bz2
Ninja: Avoid re-linking a Swift executable on every build
Swift doesn't emit swiftmodules for executables, so we shouldn't put it in dependency graph. Ninja sees the "missing" dependency and always tries to rebuild/re-link the target.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 895a4c3..21409d7 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -1112,7 +1112,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
this->GetObjectFilePath(source, config));
}
}
- linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]);
+ if (targetType != cmStateEnums::EXECUTABLE) {
+ linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]);
+ }
} else {
linkBuild.ExplicitDeps = this->GetObjects(config);
}