diff options
author | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-06-14 11:10:03 (GMT) |
---|---|---|
committer | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-09-13 16:23:56 (GMT) |
commit | fddd0f0443b4ce81d61f15ee1b2f13105967b25a (patch) | |
tree | 46e0ed1f11a9ac721672977758c2a628478cba32 /Source/cmQtAutoRcc.cxx | |
parent | 10b09647f2699b32c3d243f595437cb1c63049e2 (diff) | |
download | CMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.zip CMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.tar.gz CMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.tar.bz2 |
Autogen: AUTO*_EXECUTABLE: add support for per-config values
* Per-config values were added to `AUTO*_EXECUTABLE`.
* Dependency order was refactored for `cmake_autogen` and `cmake_autorcc` to
avoid unnecessary rebuilds.
* A new parameter was added for `cmake_autogen` and `cmake_autorcc` to specify the config name of the `auto*_executable` to be used.
* The timestamp target was split into three targets for per-config to avoid redundant `mocs_compilation` builds.
* Per-config `DEP_FILE_RULE_NAME` values were added to `AutogenInfo.json` for `CMAKE_CROSS_CONFIG` usage.
* Some functions were refactored to avoid code duplication.
Fixes: #20074
Diffstat (limited to 'Source/cmQtAutoRcc.cxx')
-rw-r--r-- | Source/cmQtAutoRcc.cxx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx index e288645..488f704 100644 --- a/Source/cmQtAutoRcc.cxx +++ b/Source/cmQtAutoRcc.cxx @@ -53,6 +53,7 @@ private: // -- Config settings bool MultiConfig_ = false; + bool CrossConfig_ = false; // -- Directories std::string AutogenBuildDir_; std::string IncludeDir_; @@ -92,26 +93,44 @@ bool cmQtAutoRccT::InitFromInfo(InfoT const& info) { // -- Required settings if (!info.GetBool("MULTI_CONFIG", this->MultiConfig_, true) || + !info.GetBool("CROSS_CONFIG", this->CrossConfig_, true) || !info.GetString("BUILD_DIR", this->AutogenBuildDir_, true) || !info.GetStringConfig("INCLUDE_DIR", this->IncludeDir_, true) || - !info.GetString("RCC_EXECUTABLE", this->RccExecutable_, true) || - !info.GetArray("RCC_LIST_OPTIONS", this->RccListOptions_, false) || + !info.GetArrayConfig("RCC_LIST_OPTIONS", this->RccListOptions_, false) || !info.GetString("LOCK_FILE", this->LockFile_, true) || !info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) || !info.GetString("SOURCE", this->QrcFile_, true) || !info.GetString("OUTPUT_CHECKSUM", this->RccPathChecksum_, true) || !info.GetString("OUTPUT_NAME", this->RccFileName_, true) || !info.GetArray("OPTIONS", this->Options_, false) || - !info.GetArray("INPUTS", this->Inputs_, false)) { + !info.GetArrayConfig("INPUTS", this->Inputs_, false)) { return false; } + if (this->CrossConfig_) { + std::string const rccExecutableWithConfig = + "RCC_EXECUTABLE_" + this->ExecutableConfig(); + if (!info.GetString(rccExecutableWithConfig, this->RccExecutable_, true)) { + return false; + } + } else { + if (!info.GetStringConfig("RCC_EXECUTABLE", this->RccExecutable_, true)) { + return false; + } + } + // -- Derive information this->QrcFileName_ = cmSystemTools::GetFilenameName(this->QrcFile_); this->QrcFileDir_ = cmSystemTools::GetFilenamePath(this->QrcFile_); - this->RccFilePublic_ = - cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, '/', - this->RccFileName_); + if (this->CrossConfig_) { + this->RccFilePublic_ = + cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, "_", + this->InfoConfig(), '/', this->RccFileName_); + } else { + this->RccFilePublic_ = + cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, '/', + this->RccFileName_); + } // rcc output file name if (this->IsMultiConfig()) { @@ -520,7 +539,8 @@ bool cmQtAutoRccT::GenerateWrapper() } // End of unnamed namespace -bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config) +bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config, + cm::string_view executableConfig) { - return cmQtAutoRccT().Run(infoFile, config); + return cmQtAutoRccT().Run(infoFile, config, executableConfig); } |