Skip to content

Commit 6d87d0f

Browse files
committed
fix: force Google Test to use shared CRT on Windows
Set gtest_force_shared_crt=ON before FetchContent to ensure Google Test uses dynamic runtime library (/MD) matching the rest of the project.
1 parent d4fa951 commit 6d87d0f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Force Google Test to use shared CRT (/MD) on Windows to match our settings
2+
if(MSVC)
3+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
4+
endif()
5+
16
FetchContent_Declare(
27
googletest
38
GIT_REPOSITORY https://github.com/google/googletest.git

0 commit comments

Comments
 (0)