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 2044992eed

Fixes: QTBUG-87735
Change-Id: I1b3d4cc122b3f502810d48e0443f39824016cab5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Cristian Adam 2020-10-28 19:35:11 +01:00
parent ec4079160a
commit 60d804c567

View File

@ -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)