From cddd023223712097e25861d0d69fcb11c49788f8 Mon Sep 17 00:00:00 2001 From: Morten Borup Petersen Date: Fri, 6 Sep 2024 14:26:15 +0200 Subject: [PATCH] Fix namespace pollution on Windows As described in https://github.com/substrait-io/substrait-cpp/issues/116, the `io.h` file in this project conflicts with `io.h` of windows. This fixes that (in the somewhat narrow compilation path that i'm exercising) by removing `include/substrait/common` from the include path, and instead relying on the (already existing) full include-path namespacing instead of relative includes of `io.h`. --- CMakeLists.txt | 2 ++ src/substrait/common/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17185468..d7637b31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,8 @@ option( "Enable substrait-cpp tests. This will enable all other build options automatically." ON) +set(SUBSTRAIT_CPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) + # Local files come first. include_directories(include) include_directories(src) diff --git a/src/substrait/common/CMakeLists.txt b/src/substrait/common/CMakeLists.txt index 70a1fc6a..a8d13564 100644 --- a/src/substrait/common/CMakeLists.txt +++ b/src/substrait/common/CMakeLists.txt @@ -21,8 +21,8 @@ add_dependencies( target_include_directories( substrait_io INTERFACE - $ - $) + $ + $) target_link_libraries(substrait_io substrait_proto substrait_textplan_converter substrait_textplan_loader absl::status absl::statusor)