Skip to content

Commit

Permalink
Fix GoogleTest dynamic runtime linking
Browse files Browse the repository at this point in the history
  • Loading branch information
perhapsmaple committed Jul 22, 2023
1 parent 583c09f commit a43337e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(BENCHMARK)
NAME googletest
GITHUB_REPOSITORY google/googletest
GIT_TAG origin/main
OPTIONS "gtest_forced_shared_crt ON"
OPTIONS "gtest_forced_shared_crt ON CACHE BOOL "" FORCE"
)

CPMAddPackage(
Expand Down
7 changes: 3 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@ if(TEST)
NAME googletest
GITHUB_REPOSITORY google/googletest
GIT_TAG origin/main
OPTIONS "gtest_forced_shared_crt ON"
OPTIONS "gtest_forced_shared_crt ON CACHE BOOL "" FORCE"
)

CPMAddPackage(
NAME zlib
GITHUB_REPOSITORY madler/zlib
VERSION 1.2.13
OPTIONS "CMAKE_POSITION_INDEPENDENT_CODE True"
VERSION 1.2.13
OPTIONS "CMAKE_POSITION_INDEPENDENT_CODE True"
)

file (GLOB TEST_FILES "*.cpp" "*.hpp")

add_executable(test_exe ${TEST_FILES})

target_compile_definitions(test_exe
Expand Down

0 comments on commit a43337e

Please sign in to comment.