From 2ba0d316cd6e00f2bc213bff529a0c6d8cdd7e01 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Mon, 9 Mar 2020 04:28:52 +0000 Subject: [PATCH] cmake: Include .pdb in zips of debug builds. Include the visualboyadvance-m.pdb file alongside the .exe for Visual Studio debug builds. Visual Studio generates this file with the debug symbols for debug builds. The file is not generated for release builds. It is also generated for RelWithDebInfo builds. Signed-off-by: Rafael Kitover --- src/wx/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index f66a916d..db8830f4 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -1048,10 +1048,16 @@ if(UPSTREAM_RELEASE AND WIN32) set(exezip visualboyadvance-m-Win-${BITS}bit.zip) + unset(pdb_file) + + if(MSVC AND CMAKE_BUILD_TYPE MATCHES Debug) + set(pdb_file visualboyadvance-m.pdb) + endif() + add_custom_command( TARGET visualboyadvance-m POST_BUILD - COMMAND ${ZIP_PROGRAM} -9 ${exezip} visualboyadvance-m.exe + COMMAND ${ZIP_PROGRAM} -9 ${exezip} visualboyadvance-m.exe ${pdb_file} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )