File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,10 @@ if (MSVC)
3636 # disable Visual Studio warnings for fopen() used in the example
3737 add_definitions (-D_CRT_SECURE_NO_WARNINGS)
3838 # Flags for linking with multithread static C++ runtime, required by internal googletest
39- # inspired from Zlib licensed glfw https://github.com/glfw/glfw/blob/master/CMakeLists.txt
40- option (SQLITECPP_USE_STATIC_RUNTIME "Use MSVC static runtime (default for internal googletest)." ${SQLITECPP_BUILD_TESTS} )
39+ option (SQLITECPP_USE_STATIC_RUNTIME "Use MSVC static runtime (default for internal googletest)." FALSE )
4140 if (SQLITECPP_USE_STATIC_RUNTIME)
4241 message (STATUS "Linking against multithread static C++ runtime" )
42+ # inspired from Zlib licensed glfw https://github.com/glfw/glfw/blob/master/CMakeLists.txt
4343 foreach (flag CMAKE_C_FLAGS
4444 CMAKE_C_FLAGS_DEBUG
4545 CMAKE_C_FLAGS_RELEASE
@@ -55,6 +55,11 @@ if (MSVC)
5555 string (REGEX REPLACE "/MD" "/MT" ${flag} "${${flag} }" )
5656
5757 endforeach ()
58+ else (SQLITECPP_USE_STATIC_RUNTIME)
59+ if (SQLITECPP_BUILD_TESTS)
60+ message (STATUS "Force googletest to link against dynamic C++ runtime" )
61+ set (gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib even when Google Test is built as static lib." )
62+ endif (SQLITECPP_BUILD_TESTS)
5863 endif (SQLITECPP_USE_STATIC_RUNTIME)
5964 # MSVC versions prior to 2015 are not supported anymore by SQLiteC++ 3.x
6065 if (MSVC_VERSION LESS 1900) # OR MSVC_TOOLSET_VERSION LESS 140)
You can’t perform that action at this time.
0 commit comments