summaryrefslogtreecommitdiffstats
path: root/src/tools/rcc/main.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-03-09 19:16:28 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-12 11:41:26 +0100
commit14546d1816a877690cda71f02c275303ef42afa8 (patch)
tree0c5ac465688285bb789aa3034cd6b0000b1a0ab7 /src/tools/rcc/main.cpp
parent39ad96033ced146567d68929a50131a6ab410f2d (diff)
rcc: Teach rcc the --no-zstd option
It is needed when cross-building Qt using CMake, where the zstd feature might have different values between the host and target, in which case the build system tells rcc not to use zstd when the feature is disabled. Amends d20c9805763ab3dc504ebf2cefd33499d89ef22c Change-Id: I9dc55b59b1be5272b79aa5f1e2daf2b516a157d6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/tools/rcc/main.cpp')
-rw-r--r--src/tools/rcc/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp
index ac87e48e39..0c3290b34b 100644
--- a/src/tools/rcc/main.cpp
+++ b/src/tools/rcc/main.cpp
@@ -180,6 +180,9 @@ int runRcc(int argc, char *argv[])
QCommandLineOption nocompressOption(QStringLiteral("no-compress"), QStringLiteral("Disable all compression. Same as --compress-algo=none."));
parser.addOption(nocompressOption);
+ QCommandLineOption noZstdOption(QStringLiteral("no-zstd"), QStringLiteral("Disable usage of zstd compression."));
+ parser.addOption(noZstdOption);
+
QCommandLineOption thresholdOption(QStringLiteral("threshold"), QStringLiteral("Threshold to consider compressing files."), QStringLiteral("level"));
parser.addOption(thresholdOption);
@@ -252,6 +255,8 @@ int runRcc(int argc, char *argv[])
errorMsg = QLatin1String("Zstandard compression requires format version 3 or higher");
if (parser.isSet(nocompressOption))
library.setCompressionAlgorithm(RCCResourceLibrary::CompressionAlgorithm::None);
+ if (parser.isSet(noZstdOption))
+ library.setNoZstd(true);
if (parser.isSet(compressOption) && errorMsg.isEmpty()) {
int level = library.parseCompressionLevel(library.compressionAlgorithm(), parser.value(compressOption), &errorMsg);
library.setCompressLevel(level);