Skip to content

Commit 9de27a3

Browse files
committed
Fixing Windows test crash
1 parent f0c0e05 commit 9de27a3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
cmake_minimum_required(VERSION 3.5)
1919

20-
cmake_policy(SET CMP0076 NEW) #target_sources() command converts relative paths to absolute
20+
cmake_policy(SET CMP0076 NEW) # target_sources() command converts relative paths to absolute
2121

2222
if(CMAKE_VERSION VERSION_LESS 3.21)
2323
get_property(not_top DIRECTORY PROPERTY PARENT_DIRECTORY)
@@ -26,6 +26,15 @@ if(CMAKE_VERSION VERSION_LESS 3.21)
2626
endif()
2727
endif()
2828

29+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
30+
# the following only works in top level so there is no need to check
31+
# PROJECT_IS_TOP_LEVEL which will not work before project() call anyway
32+
cmake_policy(SET CMP0091 NEW) # use MSVC_RUNTIME_LIBRARY property
33+
if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
34+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
35+
endif()
36+
endif()
37+
2938
file(READ VERSION SMJNI_VERSION)
3039
if (NOT SMJNI_VERSION)
3140
message(FATAL_ERROR "Cannot determine library version (VERSION file not found)")

0 commit comments

Comments
 (0)