From 1d511299f897c40100d087df5ba465843f3a49fd Mon Sep 17 00:00:00 2001 From: ShelbyZ Date: Sun, 22 Oct 2017 09:28:19 -0700 Subject: [PATCH 1/3] Correctly applying /ZI for debug - /ZI is not a link flag - /ZI is not settable via CMAKE_CXX_FLAGS - /Zi is default unless add_defitions(/ZI) --- cmake/compiler.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index ce738e14..0add161f 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -9,10 +9,15 @@ else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") - # edit and continue if(CMAKE_BUILD_TYPE STREQUAL "Debug") + # edit and continue message(STATUS "Enabling Edit and Continue..") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL /ZI") + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZI") + add_definitions(/ZI) + + # incremental linking + message(STATUS "Enabling Incremental Linking..") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL") endif() endif() From e5c1dcc78cd77bd97915034f8134cb885a95ab5a Mon Sep 17 00:00:00 2001 From: ShelbyZ Date: Sun, 22 Oct 2017 09:29:22 -0700 Subject: [PATCH 2/3] Removing comment --- cmake/compiler.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 0add161f..c5528976 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -12,7 +12,6 @@ else() if(CMAKE_BUILD_TYPE STREQUAL "Debug") # edit and continue message(STATUS "Enabling Edit and Continue..") - #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZI") add_definitions(/ZI) # incremental linking From a162a7caea5d9669a1663b2cb581f57f48fa3160 Mon Sep 17 00:00:00 2001 From: ShelbyZ Date: Sun, 22 Oct 2017 10:43:33 -0700 Subject: [PATCH 3/3] Need to disable SAFESEH before /ZI --- cmake/compiler.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index c5528976..ebf42d84 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -10,6 +10,10 @@ else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") if(CMAKE_BUILD_TYPE STREQUAL "Debug") + # disabling SAFESEH + message(STATUS "Disabling Safe Exception Handlers..") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") + # edit and continue message(STATUS "Enabling Edit and Continue..") add_definitions(/ZI)