diff options
-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() |