From aeae5ede9285666dcd48a1f4790b7a60093a0e67 Mon Sep 17 00:00:00 2001 From: Heiko Becker Date: Sun, 3 Aug 2025 20:30:51 +0200 Subject: Autogen/RCC: Only pass --no-zstd to Qt6 In commit 9e87df4d46 (Autogen/RCC: Disable zstd if it is not supported, 2024-02-08, v3.29.0-rc1~5^2) we added this flag, but it doesn't exist for Qt 5. It was only introduced with qtbase commit `14546d1816a8`, which first appeared in Qt 6. Fixes: #27111 Issue: #25664 --- Source/cmQtAutoGenInitializer.cxx | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index d73fc72..36d75af 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -920,21 +920,24 @@ bool cmQtAutoGenInitializer::InitRcc() // Disable zstd if it is not supported { - std::string const qtFeatureZSTD = "QT_FEATURE_zstd"; - if (this->GenTarget->Target->GetMakefile()->IsDefinitionSet( - qtFeatureZSTD)) { - auto const zstdDef = - this->GenTarget->Target->GetMakefile()->GetSafeDefinition( - qtFeatureZSTD); - auto const 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 + ";"); + if (this->QtVersion.Major >= 6) { + std::string const qtFeatureZSTD = "QT_FEATURE_zstd"; + if (this->GenTarget->Target->GetMakefile()->IsDefinitionSet( + qtFeatureZSTD)) { + auto const zstdDef = + this->GenTarget->Target->GetMakefile()->GetSafeDefinition( + qtFeatureZSTD); + auto const 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); } - this->GenTarget->Target->SetProperty(kw.AUTORCC_OPTIONS, rccOptions); } } } -- cgit v0.12