diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d2c0f655..73805d0d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,8 @@ if (MSVC) endif () # /bigobj (Increase Number of Sections in .Obj file) # error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm90' or greater - add_compile_options(-bigobj -Zm316) + # Generate symbols at every build target, even for the release. + add_compile_options(-bigobj -Zm316 /Zi) endif () # Display and check CMAKE_PREFIX_PATH diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b1fcd5612..e2745e4dd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -121,6 +121,8 @@ if (SLIC3R_GUI) endif() if (MSVC) + # Generate debug symbols even in release mode. + target_link_options(PrusaSlicer PUBLIC "$<$:/DEBUG>") target_link_libraries(PrusaSlicer user32.lib Setupapi.lib OpenGL32.Lib GlU32.Lib) elseif (MINGW) target_link_libraries(PrusaSlicer -lopengl32) @@ -135,11 +137,15 @@ endif () # Also the shim may load the Mesa software OpenGL renderer if the default renderer does not support OpenGL 2.0 and higher. if (MSVC) add_executable(PrusaSlicer_app_gui WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/PrusaSlicer.rc) + # Generate debug symbols even in release mode. + target_link_options(PrusaSlicer_app_gui PUBLIC "$<$:/DEBUG>") target_compile_definitions(PrusaSlicer_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE) add_dependencies(PrusaSlicer_app_gui PrusaSlicer) set_target_properties(PrusaSlicer_app_gui PROPERTIES OUTPUT_NAME "prusa-slicer") add_executable(PrusaSlicer_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/PrusaSlicer.rc) + # Generate debug symbols even in release mode. + target_link_options(PrusaSlicer_app_console PUBLIC "$<$:/DEBUG>") target_compile_definitions(PrusaSlicer_app_console PRIVATE -DSLIC3R_WRAPPER_CONSOLE) add_dependencies(PrusaSlicer_app_console PrusaSlicer) set_target_properties(PrusaSlicer_app_console PROPERTIES OUTPUT_NAME "prusa-slicer-console")