Skip to content

Commit

Permalink
Fix namespace pollution on Windows
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 committed Sep 7, 2024
1 parent 94ff855 commit cddd023
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 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
4 changes: 2 additions & 2 deletions src/substrait/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ add_dependencies(
target_include_directories(
substrait_io
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../include/substrait/common>
$<INSTALL_INTERFACE:include/substrait/common>)
$<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 cddd023

Please sign in to comment.