From 03760889013210041038398e595639d04b4f1cc3 Mon Sep 17 00:00:00 2001 From: Morten Borup Petersen Date: Sat, 7 Sep 2024 10:03:08 +0200 Subject: [PATCH] Fix namespace pollution on Windows (#117) 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 | 6 ++---- 2 files changed, 4 insertions(+), 4 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..8a10f222 100644 --- a/src/substrait/common/CMakeLists.txt +++ b/src/substrait/common/CMakeLists.txt @@ -19,10 +19,8 @@ add_dependencies( absl::status absl::statusor) target_include_directories( - substrait_io - INTERFACE - $ - $) + substrait_io INTERFACE $ + $) target_link_libraries(substrait_io substrait_proto substrait_textplan_converter substrait_textplan_loader absl::status absl::statusor)