diff options
author | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2024-02-08 12:48:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-02-09 14:10:41 (GMT) |
commit | 9e87df4d468fb8d3a835cbdfeca30fee9586e00d (patch) | |
tree | 47cbf7686661af362b30c39673a4f6cfc37f66c1 /Source | |
parent | c673511263822c688fa302120a29e1e0cf812c0b (diff) | |
download | CMake-9e87df4d468fb8d3a835cbdfeca30fee9586e00d.zip CMake-9e87df4d468fb8d3a835cbdfeca30fee9586e00d.tar.gz CMake-9e87df4d468fb8d3a835cbdfeca30fee9586e00d.tar.bz2 |
Autogen/RCC: Disable zstd if it is not supported
Add the `--no-zstd` argument for `RCC` when `QT_FEATURE_zstd` is `OFF`.
This causes user project builds to fail. That bug is fixed in Qt
by https://codereview.qt-project.org/c/qt/qtbase/+/537546 but for
the older versions, fix it here too.
Fixes: #25664
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index aaf1817..8542206 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -883,6 +883,27 @@ bool cmQtAutoGenInitializer::InitRcc() } } + // Disable zstd if it is not supported + { + std::string const qtFeatureZSTD = "QT_FEATURE_zstd"; + if (this->GenTarget->Target->GetMakefile()->IsDefinitionSet( + qtFeatureZSTD)) { + const auto zstdDef = + this->GenTarget->Target->GetMakefile()->GetSafeDefinition( + qtFeatureZSTD); + const auto zstdVal = cmValue(zstdDef); + if (zstdVal.IsOff()) { + auto const& kw = this->GlobalInitializer->kw(); + auto rccOptions = this->GenTarget->GetSafeProperty(kw.AUTORCC_OPTIONS); + std::string const nozstd = "--no-zstd"; + if (rccOptions.find(nozstd) == std::string::npos) { + rccOptions.append(";" + nozstd + ";"); + } + this->GenTarget->Target->SetProperty(kw.AUTORCC_OPTIONS, rccOptions); + } + } + } + return true; } |