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.
This commit is contained in:
Evan Wilde
2022-11-11 09:59:59 -08:00
committed by Brad King
parent 0c71f3c943
commit 38c8807c5a
5 changed files with 16 additions and 1 deletions
+3 -1
View File
@@ -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);
}