diff options
author | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-06-29 15:00:36 (GMT) |
---|---|---|
committer | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-09-13 13:59:54 (GMT) |
commit | cac2e029f02213648699665a962def96d41b2b05 (patch) | |
tree | c637ed1dfcea42991b6a41a34f26f30532f1d7ea | |
parent | d4889361f0a52632ba2b22710348f1dc2f9fb807 (diff) | |
download | CMake-cac2e029f02213648699665a962def96d41b2b05.zip CMake-cac2e029f02213648699665a962def96d41b2b05.tar.gz CMake-cac2e029f02213648699665a962def96d41b2b05.tar.bz2 |
cmQtAutoGenInitializer: Define CrossConfig variable
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 10 | ||||
-rw-r--r-- | Source/cmQtAutoGenInitializer.h | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 4db6e1d..b78d557 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -332,6 +332,8 @@ cmQtAutoGenInitializer::cmQtAutoGenInitializer( this->Uic.Enabled = uicEnabled; this->Rcc.Enabled = rccEnabled; this->Rcc.GlobalTarget = globalAutoRccTarget; + this->CrossConfig = + !this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty(); } bool cmQtAutoGenInitializer::InitCustomTargets() @@ -1026,8 +1028,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() if (this->MocOrUicEnabled() && !this->AutogenTarget.FilesGenerated.empty()) { if (this->CMP0071Accept) { // Let the autogen target depend on the GENERATED files - if (this->MultiConfig && - this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty()) { + if (this->MultiConfig && !this->CrossConfig) { for (MUFile const* muf : this->AutogenTarget.FilesGenerated) { if (muf->Configs.empty()) { this->AutogenTarget.DependFiles.insert(muf->FullPath); @@ -1190,8 +1191,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() if (this->Moc.Enabled) { this->AddGeneratedSource(this->Moc.CompilationFile, this->Moc, true); if (useDepfile) { - if (this->MultiConfig && - !this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty() && + if (this->MultiConfig && this->CrossConfig && this->GlobalGen->GetName().find("Ninja") != std::string::npos) { // Make all mocs_compilation_<CONFIG>.cpp files byproducts of the // ${target}_autogen/timestamp custom command. @@ -1239,7 +1239,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() this->GlobalGen->GetQtAutoGenConfigs(configs); bool constexpr stdPipesUTF8 = true; cmCustomCommandLines commandLines; - if (this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty()) { + if (!this->CrossConfig) { std::string autogenInfoFileConfig; if (this->MultiConfig) { autogenInfoFileConfig = "$<CONFIG>"; diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index 6d5261a..a44d33f 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -167,6 +167,7 @@ private: IntegerVersion QtVersion; unsigned int Verbosity = 0; bool MultiConfig = false; + bool CrossConfig = false; bool CMP0071Accept = false; bool CMP0071Warn = false; bool CMP0100Accept = false; |