diff options
author | Brad King <brad.king@kitware.com> | 2024-02-16 14:32:05 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-02-16 14:32:15 (GMT) |
commit | 273463aaa99f4a6d046b76c29f86c4bbd61dbb6e (patch) | |
tree | af5f36ec968713cd8108260efef5e06ec86d2ecd /Source | |
parent | 00fcb1dc812dd9578be831156e4c60c458af16c2 (diff) | |
parent | a7424b636b28ce0b6f9d7156dd3e1fe0e487f643 (diff) | |
download | CMake-273463aaa99f4a6d046b76c29f86c4bbd61dbb6e.zip CMake-273463aaa99f4a6d046b76c29f86c4bbd61dbb6e.tar.gz CMake-273463aaa99f4a6d046b76c29f86c4bbd61dbb6e.tar.bz2 |
Merge topic 'cxxmodules-collation-restat' into release-3.29
a7424b636b Ninja: make the collator rule use `restat = 1`
e24eecfc33 Tests/CXXModules: add a test to ensure that `restat` works for collation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9259
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 74a6bea..a3f20c3 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2786,6 +2786,7 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( // `cmNinjaTargetGenerator::ExportObjectCompileCommand` to generate the // corresponding file path. cmGeneratedFileStream mmf(cmStrCat(object.PrimaryOutput, ".modmap")); + mmf.SetCopyIfDifferent(true); mmf << mm; } @@ -2875,6 +2876,7 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( } cmGeneratedFileStream tmf(target_mods_file); + tmf.SetCopyIfDifferent(true); tmf << target_module_info; cmDyndepMetadataCallbacks cb; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index fe2cc04..a465b08 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -815,6 +815,11 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, // dyndep rules rule.RspFile = "$out.rsp"; rule.RspContent = "$in"; + // Ninja's collator writes all outputs using `cmGeneratedFileStream`, so + // they are only updated if contents actually change. Avoid running + // dependent jobs if the contents don't change by telling `ninja` to check + // the timestamp again. + rule.Restat = "1"; // Run CMake dependency scanner on the source file (using the preprocessed // source if that was performed). |