summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-08-30 16:24:18 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-08-30 18:22:56 +0200
commitcf077427127a1647d6a11037a67f263be2558446 (patch)
treee4a1ff25ec8f61601b5be591d7058eaa07bdfce2 /cmake
parentff36ab9c2ea2d72678afb75bf5ea3a7b33939b08 (diff)
cmake: some fixes
Diffstat (limited to 'cmake')
-rw-r--r--cmake/msvc.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake
index 78ce9e0d..933247b2 100644
--- a/cmake/msvc.cmake
+++ b/cmake/msvc.cmake
@@ -78,12 +78,15 @@ if(DEFINED floormat-64bit)
endif()
endif()
-set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
+set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:DEBUG,Debug>:Debug>")
add_link_options(-cgthreads:$ENV{NUMBER_OF_PROCESSORS})
set(_CFLAGS "-diagnostics:caret -Zc:inline -Zc:preprocessor -wd4117 -Zi -Zf -Zo -bigobj -cgthreads1 -vd0 -permissive-")
-if(NOT floormat-no-static-crt)
+string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDebugDLL" CACHE INTERNAL "" FORCE)
+elseif(NOT floormat-no-static-crt)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE INTERNAL "" FORCE)
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL" CACHE INTERNAL "" FORCE)
@@ -93,7 +96,7 @@ set(_CFLAGS_RELEASE "-O2 -Oit -Oy- -Ob3 -fp:fast -GS- -GF -GL -Gw -Gy")
if(NOT floormat-simd STREQUAL "")
set(_CFLAGS_RELEASE "${_CFLAGS_RELEASE} -arch:${floormat-simd}")
endif()
-set(_CFLAGS_DEBUG "-guard:cf -MTd -Gs0 -RTCs")
+set(_CFLAGS_DEBUG "-guard:cf -MDd -RTCsu")
set(_CXXFLAGS_RELEASE "${_CFLAGS_RELEASE}")
set(_CXXFLAGS_DEBUG "${_CFLAGS_DEBUG}")