diff options
-rw-r--r-- | cmake/opentrack-boilerplate.cmake | 5 | ||||
-rw-r--r-- | cmake/opentrack-platform.cmake | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake index da2737af..f716ec00 100644 --- a/cmake/opentrack-boilerplate.cmake +++ b/cmake/opentrack-boilerplate.cmake @@ -186,7 +186,10 @@ function(otr_module n_) else() install(TARGETS "${n}" ${opentrack-hier-str} ${opentrack-perms}) endif() - otr_install_pdb_current_project(${n}) + set(SDK_INSTALL_DEBUG_INFO FALSE CACHE BOOL "Whether to build and install debug info at install time") + if(SDK_INSTALL_DEBUG_INFO) + otr_install_pdb_current_project(${n}) + endif() endif() otr_compat(${n}) diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index 24cbd6de..5bb7581a 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -43,12 +43,18 @@ endif() if(MSVC) add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_HAS_ITERATOR_DEBUGGING=0 -D_SECURE_SCL=0) - set(CMAKE_CXX_FLAGS "-std:c++14 ${CMAKE_CXX_FLAGS} /Zi") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Zi") + set(CMAKE_CXX_FLAGS "-std:c++14 ${CMAKE_CXX_FLAGS}") + if(SDK_INSTALL_DEBUG_INFO) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zi") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Zi") + endif() #set(CMAKE_C_FLAGS " -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS ${CMAKE_C_FLAGS}") foreach (i SHARED MODULE EXE) - set(CMAKE_${i}_LINKER_FLAGS "${CMAKE_${i}_LINKER_FLAGS} -DYNAMICBASE -NXCOMPAT -DEBUG") + set(CMAKE_${i}_LINKER_FLAGS "${CMAKE_${i}_LINKER_FLAGS} -DYNAMICBASE -NXCOMPAT") + if(SDK_INSTALL_DEBUG_INFO) + set(CMAKE_${i}_LINKER_FLAGS "${CMAKE_${i}_LINKER_FLAGS} -DEBUG") + endif() endforeach() endif() |