summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorJeremy Day <jeremy@thebrowser.company>2023-12-15 20:18:39 (GMT)
committerJeremy Day <jeremy@thebrowser.company>2024-01-04 21:20:05 (GMT)
commit1161ad76ac569a38ad767d98ea7c5963a076696a (patch)
treee811988ff976bffb89dcdc3f96d817ff0c30b2a0 /Source
parentedb10c53256a4c308548af298eafc9ddf90b3bda (diff)
downloadCMake-1161ad76ac569a38ad767d98ea7c5963a076696a.zip
CMake-1161ad76ac569a38ad767d98ea7c5963a076696a.tar.gz
CMake-1161ad76ac569a38ad767d98ea7c5963a076696a.tar.bz2
Swift/Ninja: Always restat swift build commands
The swift toolchain leaves output files untouched if there are no meaningful input changes; without restat, this causes ninja to needlessly rebuild targets that are not actually out-of-date Fixes: #25496
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 732593f..d80adf1 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1948,6 +1948,10 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement(
this->LanguageCompilerRule(language, config, WithScanning::No));
cmNinjaVars& vars = objBuild.Variables;
+ // The swift toolchain leaves outputs untouched if there are no meaningful
+ // changes to input files (e.g. addition of a comment).
+ vars.emplace("restat", "1");
+
std::string const moduleName =
getTargetPropertyOrDefault(target, "Swift_MODULE_NAME", target.GetName());
std::string const moduleDirectory = getTargetPropertyOrDefault(