Skip to content

Commit 0376088

Browse files
authored
Fix namespace pollution on Windows (#117)
As described in #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`.
1 parent 693fe4e commit 0376088

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ option(
2929
"Enable substrait-cpp tests. This will enable all other build options automatically."
3030
ON)
3131

32+
set(SUBSTRAIT_CPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
33+
3234
# Local files come first.
3335
include_directories(include)
3436
include_directories(src)

src/substrait/common/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ add_dependencies(
1919
absl::status
2020
absl::statusor)
2121
target_include_directories(
22-
substrait_io
23-
INTERFACE
24-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../include/substrait/common>
25-
$<INSTALL_INTERFACE:include/substrait/common>)
22+
substrait_io INTERFACE $<BUILD_INTERFACE:${SUBSTRAIT_CPP_INCLUDE_DIR}>
23+
$<INSTALL_INTERFACE:include>)
2624
target_link_libraries(substrait_io substrait_proto substrait_textplan_converter
2725
substrait_textplan_loader absl::status absl::statusor)
2826

0 commit comments

Comments
 (0)