Skip to content

Commit 7b26c01

Browse files
authored
Add BUILD_WITH_DEFAULT_MSVC_RUNTIME_LIBRARY option
1 parent 6fc7cc2 commit 7b26c01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ option(BUILD_MCMODELLARGE "Build the library linked with mcmodel=large flag, use
3838
option(BUILD_LICCHECK_PRINT "Build libraries with licence check flag" OFF)
3939
option(BUILD_DYNRT_LIBS "Build the libraries linked against the dynamic runtime (windows only)" OFF)
4040
option(BUILD_MT_LIBS "Build the multithreaded library" OFF)
41+
option(BUILD_WITH_DEFAULT_MSVC_RUNTIME_LIBRARY "If ON, do not manually set MSVC_RUNTIME_LIBRARY property" OFF)
42+
mark_as_advanced(BUILD_WITH_DEFAULT_MSVC_RUNTIME_LIBRARY)
4143
option(BUILD_CPP "Build the cpp interface" OFF)
4244
option(BUILD_F2C "Build the f2c library" OFF)
4345
if (${CMAKE_VERSION} VERSION_LESS "3.9.0")
@@ -346,7 +348,7 @@ macro(createSingleASL name sourcedir sources)
346348
if(NOT WIN32)
347349
target_link_libraries(${name} PRIVATE m)
348350
endif()
349-
if(MSVC)
351+
if(MSVC AND NOT BUILD_WITH_DEFAULT_MSVC_RUNTIME_LIBRARY)
350352
if(${name} MATCHES "dynrt")
351353
set_property(TARGET ${name} PROPERTY
352354
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

0 commit comments

Comments
 (0)