Skip to content

Commit a8ceee2

Browse files
committed
Test some CMake options.
1 parent f92305a commit a8ceee2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ else ()
1919
endif ()
2020
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
2121

22-
# For Windows: Prevent overriding the parent project's compiler/linker settings
23-
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
24-
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE) # Ensure GoogleTest is static (default)
22+
et(GTEST_CREATE_SHARED_LIBRARY ON CACHE BOOL "Build GoogleTest as a shared library")
2523

2624
# fetch testing framework GoogleTest
2725
include(FetchContent)
@@ -32,6 +30,8 @@ else ()
3230
GIT_SHALLOW TRUE
3331
QUIET
3432
)
33+
# For Windows: Prevent overriding the parent project's compiler/linker settings
34+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
3535
FetchContent_MakeAvailable(googletest)
3636
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_OLD}")
3737
endif ()

0 commit comments

Comments
 (0)