From bd9dad7371f88dcebab53fd871f9ecf5397fc033 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Tue, 14 Nov 2017 16:13:42 +0200 Subject: MXE: move the objcopy calls to cmakelists.txt The objcopy calls to strip the debug symbols out of subsurface.exe need to happen before the installer is created (staged). Signed-off-by: Lubomir I. Ivanov --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c7222865..c504421c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -422,6 +422,18 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") install(CODE "execute_process(COMMAND cp -a ${_qt5Core_install_prefix}/qml/QtPositioning ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources/qml)") install(CODE "message(STATUS \"two ERRORS here about libmysqlclient and libpq not found are harmless\")") elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + if(NOT DEFINED OBJCOPY) + set(OBJCOPY i686-w64-mingw32.shared-objcopy) + endif() + message(STATUS "Build type is 'RelWithDebInfo'. Creating debug symbols in a separate file.") + add_custom_command(TARGET ${SUBSURFACE_TARGET} POST_BUILD + COMMAND ${OBJCOPY} --only-keep-debug ${SUBSURFACE_TARGET}.exe ${SUBSURFACE_TARGET}.exe.debug + COMMAND ${OBJCOPY} --strip-debug --strip-unneeded ${SUBSURFACE_TARGET}.exe + COMMAND ${OBJCOPY} --add-gnu-debuglink=${SUBSURFACE_TARGET}.exe.debug ${SUBSURFACE_TARGET}.exe + ) + endif() + # Windows bundling rules # We don't have a helpful tool like macdeployqt for Windows, so we hardcode # which libs we need. -- cgit v1.2.3-70-g09d2