Skip to content

Commit eb6bd46

Browse files
committed
Test some CMake options.
1 parent 9c00a49 commit eb6bd46

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
@@ -21,8 +21,7 @@ else ()
2121

2222
# For Windows: Prevent overriding the parent project's compiler/linker settings
2323
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
24-
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) # Ensure GoogleTest is static (default)
25-
set(GTEST_HAS_PTHREAD 0 CACHE BOOL "" FORCE) # Ensure no threading issues
24+
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE) # Ensure GoogleTest is static (default)
2625

2726
# fetch testing framework GoogleTest
2827
include(FetchContent)
@@ -307,8 +306,9 @@ endif ()
307306
# fix shared library linker error on Windows
308307
if (NOT GTEST_FOUND)
309308
foreach (target gmock gtest)
310-
target_compile_definitions(${target} INTERFACE GTEST_LINKED_AS_SHARED_LIBRARY=0)
309+
target_compile_definitions(${target} INTERFACE GTEST_LINKED_AS_SHARED_LIBRARY=1)
311310
endforeach ()
311+
target_compile_definitions(${PLSSVM_BASE_TEST_LIBRARY_NAME} PUBLIC GTEST_LINKED_AS_SHARED_LIBRARY=1)
312312
endif ()
313313

314314
list(POP_BACK CMAKE_MESSAGE_INDENT)

0 commit comments

Comments
 (0)