Merge pull request #5053 from zmajeedforks:zmajeed_fix_msvc_crt_override

PiperOrigin-RevId: 961026014
Change-Id: I91e5a221e335372a9c5fef9082ab05800f5b2081
This commit is contained in:
Copybara-Service
2026-08-07 11:15:29 -07:00
+2 -1
View File
@@ -71,7 +71,8 @@ macro(config_compiler_and_linker)
# 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
# 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>")
endif()