From 60d804c56769de82e658205bec687b83833a61e9 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 28 Oct 2020 19:35:11 +0100 Subject: [PATCH] Do not strip binaries for MSVC builds CMake's --install --strip command will result in calling ${CMAKE_STRIP} after installation. On the build machines we have multiple compilers, and ${CMAKE_STRIP} will have a valid program e.g. C:/strawberry/c/bin/strip.exe This will change the MSVC binaries to have a MinGW linker version flag, which confuses Qt Creator when setting up a MSVC Kit. Amends 2044992eed3e48909d17a4304ea25d3007d94d60 Fixes: QTBUG-87735 Change-Id: I1b3d4cc122b3f502810d48e0443f39824016cab5 Reviewed-by: Alexandru Croitor --- bin/qt-cmake-private-install.cmake.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/qt-cmake-private-install.cmake.in b/bin/qt-cmake-private-install.cmake.in index 6d6f3f0f0e..845394d02e 100644 --- a/bin/qt-cmake-private-install.cmake.in +++ b/bin/qt-cmake-private-install.cmake.in @@ -7,9 +7,13 @@ set(configs "@__qt_configured_configs@") if(NOT QT_BUILD_DIR) message(FATAL_ERROR "No QT_BUILD_DIR value provided to qt-cmake-private-install.") endif() +unset(strip_arg) +if ("x@MSVC@" STREQUAL "x") + set(strip_arg --strip) +endif() foreach(config ${configs}) message(STATUS "Installing configuration: '${config}'") - set(args "${CMAKE_COMMAND}" --install ${QT_BUILD_DIR} --config "${config}" --strip) + set(args "${CMAKE_COMMAND}" --install ${QT_BUILD_DIR} --config "${config}" ${strip_arg}) execute_process(COMMAND ${args} COMMAND_ECHO STDOUT RESULT_VARIABLE result)