From a1cd6fc613873d8c8e673be0185615dccf84f6f4 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Wed, 19 Jun 2024 09:31:01 -0300 Subject: [PATCH] Add --exclude-library option to standalone version It would be useful to have the standalone version also able to exclude-libraries, this helps with issues: #153 #150 #110 #108 --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 5076d6a..adcbf1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,6 +37,7 @@ int main(const int argc, const char *const *const argv) { args::HelpFlag help(parser, "help", "Display this help text", {'h', "help"}); args::ValueFlag appDirPath(parser, "appdir path", "Path to an existing AppDir", {"appdir"}); + args::ValueFlagList excludeLibraryPatterns(parser, "pattern", "Shared library to exclude from deployment (glob pattern)", {"exclude-library"}); args::ValueFlagList extraPlugins(parser, "plugin", "Extra Qt plugin to deploy (specified by name, filename or path)", {'p', "extra-plugin"}); @@ -135,6 +136,9 @@ int main(const int argc, const char *const *const argv) { ldLog() << std::endl << "Using Qt version: " << qtVersion << " (" << qtMajorVersion << ")" << std::endl; appdir::AppDir appDir(appDirPath.Get()); + if (const auto patterns = excludeLibraryPatterns.Get(); !patterns.empty()) { + appDir.setExcludeLibraryPatterns(patterns); + } // allow disabling copyright files deployment via environment variable if (getenv("DISABLE_COPYRIGHT_FILES_DEPLOYMENT") != nullptr) {