Skip to content

Commit

Permalink
Prevent gtest compiler/link errors on windows (#111)
Browse files Browse the repository at this point in the history
Substrait-cpp is (i assume) intended to embed into other projects, so other subprojects should adhere to parent projects' settings. For GTest on windows, this requires that `gtest_force_shared_crt ` is enabled
([doc](https://github.com/google/googletest/blob/main/googletest/README.md)).
  • Loading branch information
mortbopet committed Sep 5, 2024
1 parent bd9fb04 commit ef0bbe5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ include(datetime.cmake)

add_subdirectory(fmt)

if(WIN32)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt
ON
CACHE BOOL "" FORCE)
endif()

find_package(GTest QUIET)
if(NOT ${GTEST_FOUND})
message(STATUS "Retrieving external GoogleTest library.")
Expand Down

0 comments on commit ef0bbe5

Please sign in to comment.