From ef1ff65b0a3da280a33dacf94e9c3d54ba42671d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 22 Aug 2022 15:47:02 +0200 Subject: windeployqt: Directly access the 'relocatable' config feature Before, we added the preprocessor define QT_RELOCATABLE if the relocatable feature was set and checked for the define in the source code. This indirection is unnecessary. Also, widen the scope of the feature check to avoid some unnecessary code. Change-Id: Ib5f38bf310699d528efdd24edbf14b861bf33935 Reviewed-by: Alexandru Croitor --- src/tools/windeployqt/CMakeLists.txt | 5 ----- src/tools/windeployqt/main.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/tools/windeployqt/CMakeLists.txt b/src/tools/windeployqt/CMakeLists.txt index 4531124f315..e1ea486595a 100644 --- a/src/tools/windeployqt/CMakeLists.txt +++ b/src/tools/windeployqt/CMakeLists.txt @@ -28,8 +28,3 @@ qt_internal_extend_target(${target_name} CONDITION WIN32 PUBLIC_LIBRARIES shlwapi ) - -qt_internal_extend_target(${target_name} CONDITION QT_FEATURE_relocatable - DEFINES - QT_RELOCATABLE -) diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index 9d483e123fa..132b3d5d258 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -22,6 +22,8 @@ #define IMAGE_FILE_MACHINE_ARM64 0xaa64 #endif +#include + #include #include #include @@ -1452,16 +1454,16 @@ static DeployResult deploy(const Options &options, const QMap return result; } +#if !QT_CONFIG(relocatable) if (options.patchQt && !options.dryRun) { const QString qt6CoreName = QFileInfo(libraryPath(libraryLocation, "Qt6Core", qtLibInfix, options.platform, result.isDebug)).fileName(); -#ifndef QT_RELOCATABLE if (!patchQtCore(targetPath + u'/' + qt6CoreName, errorMessage)) { std::wcerr << "Warning: " << *errorMessage << '\n'; errorMessage->clear(); } -#endif } +#endif // QT_CONFIG(relocatable) } // optLibraries // Update plugins -- cgit v1.2.3