diff --git a/src/corelib/.prev_CMakeLists.txt b/src/corelib/.prev_CMakeLists.txt index e33ce41e19..8bdc2debd3 100644 --- a/src/corelib/.prev_CMakeLists.txt +++ b/src/corelib/.prev_CMakeLists.txt @@ -316,7 +316,7 @@ qt_extend_target(Core CONDITION ANDROID kernel/qsharedmemory_android.cpp kernel/qsystemsemaphore_android.cpp DEFINES - LIBS_SUFFIX='\\"_${CMAKE_SYSTEM_PROCESSOR}.so\\"' + LIBS_SUFFIX="_${CMAKE_SYSTEM_PROCESSOR}.so" ) qt_extend_target(Core CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 37079bdc72..783346578b 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -427,7 +427,7 @@ qt_extend_target(Core CONDITION ANDROID kernel/qsharedmemory_android.cpp kernel/qsystemsemaphore_android.cpp DEFINES - LIBS_SUFFIX="\\\\"_${CMAKE_SYSTEM_PROCESSOR}.so\\\\"" # special case + LIBS_SUFFIX="_${CMAKE_SYSTEM_PROCESSOR}.so" ) qt_extend_target(Core CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index de2f175953..7bc29990c5 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1956,6 +1956,18 @@ def write_defines( d.replace('=\\\\\\"$$PWD/\\\\\\"', '="${CMAKE_CURRENT_SOURCE_DIR}/"') for d in defines ] + # Handle LIBS_SUFFIX='\\"_$${QT_ARCH}.so\\"'. + # The escaping of backslashes is still needed even if it's a raw + # string, because backslashes have a special meaning for regular + # expressions (escape next char). So we actually expect to match + # 2 backslashes in the input string. + pattern = r"""([^ ]+)='\\\\"([^ ]*)\\\\"'""" + + # Replace with regular quotes, CMake will escape the quotes when + # passing the define to the compiler. + replacement = r'\1="\2"' + defines = [re.sub(pattern, replacement, d) for d in defines] + if "qml_debug" in scope.get("CONFIG"): defines.append("QT_QML_DEBUG")