From 08366ae11c6ce17adf9874fcbf96ffabac6182fc 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 c6c3bf4a25d8573db2ba3074b35f93480f42b5d6 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 b17098414bb17ca056944eadbfed15a87fe048c0 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)