diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-29 15:53:06 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-29 15:54:00 +0200 |
commit | a3ba2fe5ff1ef6c030dd2e0f69da63de5cb8d8d5 (patch) | |
tree | 33c1e914162f21b4fb6b719f694d6ef76007fd58 /cmake/msvc.cmake | |
parent | f34009428384f4244ae79a9e300fd8a35daa2175 (diff) |
cmake/msvc: add useful debug flags
Diffstat (limited to 'cmake/msvc.cmake')
-rw-r--r-- | cmake/msvc.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index bd91f00a..6c7021f8 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -40,9 +40,9 @@ set(silly "${warns_} -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_ITERATOR_DEBUG_LEVE set(_CFLAGS "${silly}") set(_CXXFLAGS "${silly}") set(_CFLAGS_RELEASE "${cc}") -set(_CFLAGS_DEBUG "/Zi /GS") +set(_CFLAGS_DEBUG "/Zi /GS /sdl /Gs /guard:cf /RTCsu") set(_CXXFLAGS_RELEASE "${cc}") -set(_CXXFLAGS_DEBUG "/Zi /GS") +set(_CXXFLAGS_DEBUG "${_CFLAGS_DEBUG}") set(ldflags-shared-release "/OPT:REF /OPT:ICF=10") set(ldflags-shared "/DEBUG /DYNAMICBASE /NXCOMPAT") @@ -71,6 +71,13 @@ foreach(j "" _DEBUG _RELEASE) endforeach() endforeach() +foreach(j "" _DEBUG _RELEASE) + foreach(i MODULE EXE SHARED) + set(OVERRIDE_LDFLAGS_SHARED${j} "" CACHE STRING "") + set(CMAKE_${i}_LINKER_FLAGS${j} "${_LDFLAGS${j}} ${_LDFLAGS_${i}} ${_LDFLAGS_${i}${j}} ${OVERRIDE_LDFLAGS_SHARED${j}}" CACHE STRING "" FORCE) + endforeach() +endforeach() + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE) @@ -85,7 +92,7 @@ if((CMAKE_GENERATOR STREQUAL "NMake Makefiles") OR (CMAKE_GENERATOR STREQUAL "NM if("$ENV{LIBPATH}" STREQUAL "") message("Error, no environment. Run:") message("--\n") - message("cmd /k call \"%vs150comntools%\"\\..\\..\\vc\\bin\\vcvars32.bat & cd /d \"${CMAKE_BINARY_DIR}\"") + message("cmd /k call \"%vs140comntools%\"\\..\\..\\vc\\bin\\vcvars32.bat & cd /d \"${CMAKE_BINARY_DIR}\"") message("\n--") message(FATAL_ERROR "cannot continue.") endif() |