Skip to content

Commit

Permalink
Do not strip binaries for MSVC builds
Browse files Browse the repository at this point in the history
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 2044992

Fixes: QTBUG-87735
Change-Id: I1b3d4cc122b3f502810d48e0443f39824016cab5
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
cristianadam committed Oct 29, 2020
1 parent ec40791 commit 60d804c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/qt-cmake-private-install.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 60d804c

Please sign in to comment.