Skip to content

Commit 3e35404

Browse files
authored
Merge pull request #236 Disable explicit setting of MSVC runtime from BioDataAnalysis/emmenlau_remove_msvc_runtime_setting
2 parents adb7e7c + 521181c commit 3e35404

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
2020
message (STATUS "CMake version: ${CMAKE_VERSION}")
2121
message (STATUS "Project version: ${PROJECT_VERSION}")
2222

23+
option(SQLITECPP_USE_STATIC_RUNTIME "Use MSVC static runtime (default for internal googletest)." ON)
24+
2325
# Define useful variables to handle OS differences:
2426
if (WIN32)
2527
set(DEV_NULL "NUL")
@@ -33,14 +35,14 @@ if (MSVC)
3335
set(CPPCHECK_ARG_TEMPLATE "--template=vs")
3436
# disable Visual Studio warnings for fopen() used in the example
3537
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
36-
# Flags for linking with multithread static C++ runtime, required by googletest
37-
if (SQLITECPP_BUILD_TESTS)
38-
message(STATUS "Linking against multithread static C++ runtime for unit tests with googletest")
38+
# Flags for linking with multithread static C++ runtime, required by internal googletest
39+
if (SQLITECPP_USE_STATIC_RUNTIME)
40+
message(STATUS "Linking against multithread static C++ runtime")
3941
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
4042
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
4143
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
4244
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
43-
endif (SQLITECPP_BUILD_TESTS)
45+
endif (SQLITECPP_USE_STATIC_RUNTIME)
4446
# MSVC versions prior to 2015 are not supported anymore by SQLiteC++ 3.x
4547
if (MSVC_VERSION LESS 1900) # OR MSVC_TOOLSET_VERSION LESS 140)
4648
message(ERROR "Visual Studio prior to 2015 is not supported anymore.")

0 commit comments

Comments
 (0)