Skip to content

Commit ef0bbe5

Browse files
authored
Prevent gtest compiler/link errors on windows (#111)
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)).
1 parent bd9fb04 commit ef0bbe5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

third_party/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ include(datetime.cmake)
1313

1414
add_subdirectory(fmt)
1515

16+
if(WIN32)
17+
# For Windows: Prevent overriding the parent project's compiler/linker settings
18+
set(gtest_force_shared_crt
19+
ON
20+
CACHE BOOL "" FORCE)
21+
endif()
22+
1623
find_package(GTest QUIET)
1724
if(NOT ${GTEST_FOUND})
1825
message(STATUS "Retrieving external GoogleTest library.")

0 commit comments

Comments
 (0)