mirror of
https://github.com/google/googletest.git
synced 2026-10-28 18:07:18 +08:00
Fix issue 5042: Don't override VC++ project C runtime library settings when googletest is used through cmake FetchContent or add_subdirectory
This commit is contained in:
parent
4f472747b1
commit
c0afb7f69d
@ -71,7 +71,8 @@ macro(config_compiler_and_linker)
|
|||||||
# as static libraries, as we don't have to rely on CRT DLLs being available.
|
# as static libraries, as we don't have to rely on CRT DLLs being available.
|
||||||
# CMake always defaults to using shared CRT libraries, so we override that
|
# CMake always defaults to using shared CRT libraries, so we override that
|
||||||
# default here.
|
# default here.
|
||||||
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY
|
||||||
|
AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user