diff options
author | Kai Koehne <[email protected]> | 2020-09-14 17:50:36 +0200 |
---|---|---|
committer | Kai Koehne <[email protected]> | 2020-09-15 15:55:47 +0200 |
commit | 61a9038877adee1ecd835312fc528c7eb409c5b3 (patch) | |
tree | f255d4498b12314c9db24ad1bdf81054f87f7c27 | |
parent | e957e9c28ffc490b27f569e2b24b007a586c76f0 (diff) |
Windows: Fix linker warning about missing WinMain.pdb
Do follow the example of winmain.pro and replace /Zi with /Z7.
Manipulating CMAKE_CXX_FLAGS_DEBUG is not particularly elegant,
but CMake seems not to offer a more modern way yet:
https://gitlab.kitware.com/cmake/cmake/-/issues/19084
Fixes: QTBUG-86423
Change-Id: I280d06ad52b79d4be04052ab4e0d2113ef08414c
Reviewed-by: Alexandru Croitor <[email protected]>
-rw-r--r-- | src/winmain/CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/winmain/CMakeLists.txt b/src/winmain/CMakeLists.txt index 73a11497177..fca26090826 100644 --- a/src/winmain/CMakeLists.txt +++ b/src/winmain/CMakeLists.txt @@ -14,6 +14,12 @@ qt_add_module(WinMain $<TARGET_PROPERTY:Qt::Core,INTERFACE_INCLUDE_DIRECTORIES> ) +if (MSVC) + # Store debug information inside the static lib + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") +endif() + set_property(TARGET WinMain PROPERTY OUTPUT_NAME qtmain) qt_extend_target(WinMain CONDITION |