Skip to content

Commit

Permalink
Prevent gtest compiler/link errors on windows
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 ... is enabled ([doc](https://github.com/google/googletest/blob/main/googletest/README.md)).
  • Loading branch information
mortbopet committed Sep 5, 2024
1 parent 9737507 commit 4087ae3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ 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 4087ae3

Please sign in to comment.