Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(c/driver/postgresql): Use target_include_directories #1123

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions c/driver/postgresql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ add_arrow_lib(adbc_driver_postgresql
adbc_driver_common
nanoarrow
${LIBPQ_STATIC_LIBRARIES})
include_directories(SYSTEM ${REPOSITORY_ROOT})
include_directories(SYSTEM ${REPOSITORY_ROOT}/c/)
include_directories(SYSTEM ${LIBPQ_INCLUDE_DIRS})
include_directories(SYSTEM ${REPOSITORY_ROOT}/c/vendor)
include_directories(SYSTEM ${REPOSITORY_ROOT}/c/driver)

foreach(LIB_TARGET ${ADBC_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ADBC_EXPORTING)
target_include_directories(${LIB_TARGET} SYSTEM
PRIVATE ${REPOSITORY_ROOT}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want this to be PUBLIC but with that set you get:

CMake Error in driver/postgresql/CMakeLists.txt:
  Target "adbc_driver_postgresql_shared" INTERFACE_INCLUDE_DIRECTORIES
  property contains path:

    "/home/willayd/clones/arrow-adbc/c/vendor"

  which is prefixed in the source directory.


CMake Error in driver/postgresql/CMakeLists.txt:
  Target "adbc_driver_postgresql_shared" INTERFACE_INCLUDE_DIRECTORIES
  property contains path:

    "/home/willayd/clones/arrow-adbc/c/driver"

  which is prefixed in the source directory.


CMake Error in driver/postgresql/CMakeLists.txt:
  Target "adbc_driver_postgresql_static" INTERFACE_INCLUDE_DIRECTORIES
  property contains path:

    "/home/willayd/clones/arrow-adbc/c/vendor"

  which is prefixed in the source directory.


CMake Error in driver/postgresql/CMakeLists.txt:
  Target "adbc_driver_postgresql_static" INTERFACE_INCLUDE_DIRECTORIES
  property contains path:

    "/home/willayd/clones/arrow-adbc/c/driver"

  which is prefixed in the source directory.

I think there is more info here but didn't follow all the way through for this repo: arvidn/libtorrent#3101 (comment)

${REPOSITORY_ROOT}/c/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
endforeach()

if(ADBC_TEST_LINKAGE STREQUAL "shared")
Expand All @@ -83,5 +84,11 @@ if(ADBC_BUILD_TESTS)
nanoarrow
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-postgresql-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-postgresql-test SYSTEM
PRIVATE ${REPOSITORY_ROOT}
${REPOSITORY_ROOT}/c/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
adbc_configure_target(adbc-driver-postgresql-test)
endif()
Loading