summaryrefslogtreecommitdiffhomepage
path: root/cmake/msvc.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/msvc.cmake')
-rw-r--r--cmake/msvc.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake
index 3009c14f..daad2b74 100644
--- a/cmake/msvc.cmake
+++ b/cmake/msvc.cmake
@@ -56,7 +56,9 @@ set(_CXXFLAGS_DEBUG "${_CFLAGS_DEBUG}")
set(_LDFLAGS "/WX /DEBUG")
set(_LDFLAGS_RELEASE "/LTCG:INCREMENTAL /OPT:REF /OPT:ICF=10")
set(_LDFLAGS_DEBUG "")
+
set(_LDFLAGS_STATIC "/WX")
+set(_LDFLAGS_STATIC_RELEASE "/LTCG:INCREMENTAL")
foreach(j C CXX)
foreach(i "" _DEBUG _RELEASE)
@@ -81,9 +83,10 @@ foreach(j "" _DEBUG _RELEASE)
endforeach()
set(OVERRIDE_LDFLAGS_STATIC "" CACHE STRING "")
+set(OVERRIDE_LDFLAGS_STATIC_RELEASE "" CACHE STRING "")
set(CMAKE_STATIC_LINKER_FLAGS "${_LDFLAGS_STATIC} ${OVERRIDE_LDFLAGS_STATIC}" CACHE STRING "" FORCE)
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "" CACHE STRING "" FORCE)
-set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "" CACHE STRING "" FORCE)
+set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${_LDFLAGS_STATIC_RELEASE} ${OVERRIDE_LDFLAGS_STATIC_RELEASE}" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE)