In "Modern Cmake" you can set this for every purpose, here is the way:
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND CMAKE_BUILD_TYPE MATCHES "Release") target_compile_options(${TARGET_NAME} PRIVATE /Zi) # Tell linker to include symbol data set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "/INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF" ) # Set file name & location set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME} COMPILE_PDB_OUTPUT_DIR ${CMAKE_BINARY_DIR} ) endif()
These flags are specific to MSVC , not WIN32 .
Drumm source share