diff options
author | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-09-20 12:12:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-09-26 15:54:26 (GMT) |
commit | bac468ddfd5eb207d64af527fa12466ceecee0dd (patch) | |
tree | f9429f34978b98226fbfca35d919f5ad035909e8 /Source | |
parent | c3f0825d3c0876829d066493a3fc0f0a516fb0f2 (diff) | |
download | CMake-bac468ddfd5eb207d64af527fa12466ceecee0dd.zip CMake-bac468ddfd5eb207d64af527fa12466ceecee0dd.tar.gz CMake-bac468ddfd5eb207d64af527fa12466ceecee0dd.tar.bz2 |
AutoGen: Fix regression in timestamps on multi-config generators
Since commit fddd0f0443 (Autogen: AUTO*_EXECUTABLE: add support for
per-config values, 2023-06-14) we do not correctly generate outputs
for one configuration after another configuration has been built.
Fix this:
- Revert some config based stuff for `Xcode` due to the `$<CONFIG>`
genex usage limitation in source files with `Xcode`.
- For multi-config generators use a per-config `timestamp_$<CONFIG>`
file instead of one `timestamp` file.
Fixes: #25261
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 11 | ||||
-rw-r--r-- | Source/cmQtAutoRcc.cxx | 9 |
2 files changed, 17 insertions, 3 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index d6d3999..a33c5db 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1175,7 +1175,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() // Path checksum qrc.QrcPathChecksum = this->PathCheckSum.getPart(qrc.QrcFile); // Output file name - if (this->CrossConfig) { + if (this->MultiConfig && !this->GlobalGen->IsXcode()) { qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum, "_$<CONFIG>", "/qrc_", qrc.QrcName, ".cpp"); } else { @@ -1467,7 +1467,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() std::string outputFile; std::string depFile; // Create the custom command that outputs the timestamp file. - if (this->MultiConfig && this->CrossConfig) { + if (this->MultiConfig) { // create timestamp file with $<CONFIG> in the name so that // every cmake_autogen target has its own timestamp file std::string const configView = "$<CONFIG>"; @@ -1577,6 +1577,12 @@ void cmQtAutoGenInitializer::AddCMakeProcessToCommandLines( commandLines.push_back(cmMakeCommandLine( { cmSystemTools::GetCMakeCommand(), "-E", processName, infoFile, "$<CONFIG>", "$<COMMAND_CONFIG:$<CONFIG>>" })); + } else if (this->MultiConfig && this->GlobalGen->IsXcode()) { + for (std::string const& config : this->ConfigsList) { + commandLines.push_back( + cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E", + processName, infoFile, config })); + } } else { std::string autoInfoFileConfig; if (this->MultiConfig) { @@ -1934,6 +1940,7 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo() info.SetBool("MULTI_CONFIG", this->MultiConfig); info.SetBool("CROSS_CONFIG", this->CrossConfig); info.SetUInt("VERBOSITY", this->Verbosity); + info.Set("GENERATOR", this->GlobalGen->GetName()); // Files info.Set("LOCK_FILE", qrc.LockFile); diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx index 488f704..576f611 100644 --- a/Source/cmQtAutoRcc.cxx +++ b/Source/cmQtAutoRcc.cxx @@ -35,6 +35,11 @@ public: private: // -- Utility bool IsMultiConfig() const { return this->MultiConfig_; } + std::string const& GetGenerator() const { return this->Generator_; } + bool IsXcode() const + { + return this->GetGenerator().find("Xcode") != std::string::npos; + } std::string MultiConfigOutput() const; // -- Abstract processing interface @@ -54,6 +59,7 @@ private: // -- Config settings bool MultiConfig_ = false; bool CrossConfig_ = false; + std::string Generator_; // -- Directories std::string AutogenBuildDir_; std::string IncludeDir_; @@ -93,6 +99,7 @@ bool cmQtAutoRccT::InitFromInfo(InfoT const& info) { // -- Required settings if (!info.GetBool("MULTI_CONFIG", this->MultiConfig_, true) || + !info.GetString("GENERATOR", this->Generator_, true) || !info.GetBool("CROSS_CONFIG", this->CrossConfig_, true) || !info.GetString("BUILD_DIR", this->AutogenBuildDir_, true) || !info.GetStringConfig("INCLUDE_DIR", this->IncludeDir_, true) || @@ -122,7 +129,7 @@ bool cmQtAutoRccT::InitFromInfo(InfoT const& info) // -- Derive information this->QrcFileName_ = cmSystemTools::GetFilenameName(this->QrcFile_); this->QrcFileDir_ = cmSystemTools::GetFilenamePath(this->QrcFile_); - if (this->CrossConfig_) { + if (IsMultiConfig() && !this->IsXcode()) { this->RccFilePublic_ = cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, "_", this->InfoConfig(), '/', this->RccFileName_); |