Skip to content

Commit

Permalink
CMake: Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez committed Aug 6, 2019
1 parent c65c40a commit 6bfa437
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
7 changes: 0 additions & 7 deletions 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 ()
Expand Down
9 changes: 0 additions & 9 deletions 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()
14 changes: 13 additions & 1 deletion src/app/CMakeLists.txt
Expand Up @@ -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
Expand Down

0 comments on commit 6bfa437

Please sign in to comment.