Skip to content

Commit

Permalink
Fix namespace pollution on Windows (#117)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
mortbopet authored Sep 7, 2024
1 parent 693fe4e commit 0376088
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions src/substrait/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ add_dependencies(
absl::status
absl::statusor)
target_include_directories(
substrait_io
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../include/substrait/common>
$<INSTALL_INTERFACE:include/substrait/common>)
substrait_io INTERFACE $<BUILD_INTERFACE:${SUBSTRAIT_CPP_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
target_link_libraries(substrait_io substrait_proto substrait_textplan_converter
substrait_textplan_loader absl::status absl::statusor)

Expand Down

0 comments on commit 0376088

Please sign in to comment.