diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-14 16:13:42 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-15 12:28:51 +0100 |
commit | bd9dad7371f88dcebab53fd871f9ecf5397fc033 (patch) | |
tree | 7b37ffe5a4d906bf13f8c6eb2de71d5962db0a89 /CMakeLists.txt | |
parent | f02388d6b795509fd6e94b0aa0348bfcf0a5af71 (diff) | |
download | subsurface-bd9dad7371f88dcebab53fd871f9ecf5397fc033.tar.gz |
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 <neolit123@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
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. |