From 6bfa4370b7da2fbd38c3a31aa994f658b45d644f Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Tue, 6 Aug 2019 21:50:39 +0300 Subject: [PATCH] CMake: Fix Windows build --- cmake/Modules/winconf-mingw.cmake | 7 ------- cmake/Modules/winconf-msvc.cmake | 9 --------- src/app/CMakeLists.txt | 14 +++++++++++++- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/cmake/Modules/winconf-mingw.cmake b/cmake/Modules/winconf-mingw.cmake index 5e55d54083..ace955c5a4 100644 --- a/cmake/Modules/winconf-mingw.cmake +++ b/cmake/Modules/winconf-mingw.cmake @@ -1,10 +1,3 @@ -if (STACKTRACE) - if (NOT "${WINXXBITS}" STREQUAL "Win64") - add_compile_options(-fno-omit-frame-pointer) - endif (NOT "${WINXXBITS}" STREQUAL "Win64") - link_libraries(dbghelp -Wl,--export-all-symbols) -endif (STACKTRACE) - if (("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")) link_libraries(-Wl,--dynamicbase) endif () diff --git a/cmake/Modules/winconf-msvc.cmake b/cmake/Modules/winconf-msvc.cmake index ef7b16f993..2b059b65ef 100644 --- a/cmake/Modules/winconf-msvc.cmake +++ b/cmake/Modules/winconf-msvc.cmake @@ -1,12 +1,3 @@ -if (STACKTRACE) - if (NOT "${WINXXBITS}" STREQUAL "Win64") - # i686 arch requires frame pointer preservation - add_compile_options(-Oy-) - endif (NOT "${WINXXBITS}" STREQUAL "Win64") - add_compile_options(-Zi) - link_libraries(dbghelp -DEBUG) -endif (STACKTRACE) - include(MacroConfigureMSVCRuntime) set(MSVC_RUNTIME "dynamic") configure_msvc_runtime() diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 8b548586ec..84f703e995 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -67,10 +67,22 @@ if (STACKTRACE) if (Qt5Widgets_FOUND) target_sources(qBittorrent PRIVATE stacktracedialog.cpp stacktracedialog.h) endif (Qt5Widgets_FOUND) + if (MSVC) + if (NOT "${WINXXBITS}" STREQUAL "Win64") + # i686 arch requires frame pointer preservation + add_compile_options(-Oy-) + endif (NOT "${WINXXBITS}" STREQUAL "Win64") + add_compile_options(-Zi) + target_link_libraries(qBittorrent PUBLIC dbghelp -DEBUG) + else (MSVC) + if (NOT "${WINXXBITS}" STREQUAL "Win64") + add_compile_options(-fno-omit-frame-pointer) + endif (NOT "${WINXXBITS}" STREQUAL "Win64") + target_link_libraries(qBittorrent PUBLIC dbghelp -Wl,--export-all-symbols) + endif (MSVC) endif (UNIX) endif (STACKTRACE) - if (Qt5Widgets_FOUND) target_link_libraries(qBittorrent PRIVATE qbt_searchengine qbt_gui) set_target_properties(qBittorrent