summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-11-26 10:44:43 (GMT)
committerBrad King <brad.king@kitware.com>2024-11-28 14:13:56 (GMT)
commit8a526f6a4481cbf69ffed6dc045457f4c1436783 (patch)
treef55f9e1bb8f76b39549fb0c63f5111eaea4aab61 /Source
parent3cac48e8cdfc80b2d416fa04e5e1cfc760dba294 (diff)
downloadCMake-8a526f6a4481cbf69ffed6dc045457f4c1436783.zip
CMake-8a526f6a4481cbf69ffed6dc045457f4c1436783.tar.gz
CMake-8a526f6a4481cbf69ffed6dc045457f4c1436783.tar.bz2
Autogen: Fix Ninja Multi-Config dependency graph regression
In commit 5363bebc1e (Autogen: Fix compilation of unchanged source files, 2024-07-16, v3.31.0-rc1~328^2) we relied on Ninja Multi-Config dependency graph optimizations from commit 7c39dabdbc (Autogen: AUTO*_EXECUTABLE: add support for per-config values, 2023-10-18, v3.29.0-rc1~105^2~1). However, those graph optimizations are conditional on versions of Qt that enable [`AUTOGEN_BETTER_GRAPH_MULTI_CONFIG`](https://codereview.qt-project.org/c/qt/qtbase/+/513648). `UseBetterGraph` should be checked to add ui files to `timestampByproducts`. Fixes: #26475
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx25
1 files changed, 19 insertions, 6 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 63b97f3..b75a574 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1340,12 +1340,25 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
}
if (this->Uic.Enabled) {
- // Make all ui_*.h files byproducts of the ${target}_autogen/timestamp
- // custom command if the generation of depfile is enabled.
- auto& byProducts = useDepfile ? timestampByproducts : autogenByproducts;
- for (auto const& file : this->Uic.UiHeaders) {
- this->AddGeneratedSource(file.first, this->Uic);
- byProducts.push_back(file.second);
+ auto const useAdvancedUicGraph = [this]() -> bool {
+ if (this->MultiConfig && this->GlobalGen->IsNinja()) {
+ return this->UseBetterGraph;
+ }
+ return true;
+ }();
+ if (useAdvancedUicGraph) {
+ // Make all ui_*.h files byproducts of the ${target}_autogen/timestamp
+ // custom command if the generation of depfile is enabled.
+ auto& byProducts = useDepfile ? timestampByproducts : autogenByproducts;
+ for (auto const& file : this->Uic.UiHeaders) {
+ this->AddGeneratedSource(file.first, this->Uic);
+ byProducts.push_back(file.second);
+ }
+ } else {
+ for (auto const& file : this->Uic.UiHeaders) {
+ this->AddGeneratedSource(file.first, this->Uic);
+ autogenByproducts.push_back(file.second);
+ }
}
}