Skip to content

Commit

Permalink
ARROW-8280: [C++] Use c-ares_INCLUDE_DIR
Browse files Browse the repository at this point in the history
Instead of c-ares::cares's INTERFACE_INCLUDE_DIRECTORIES. Because it
may not be set. c-ares_INCLUDE_DIR is always set.

Closes #6778 from kou/ci-mingw-fix-cares

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou committed Mar 31, 2020
1 parent 78ee4ae commit e16da50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Expand Up @@ -1952,17 +1952,19 @@ endmacro()
if(ARROW_WITH_GRPC)
if(c-ares_SOURCE STREQUAL "AUTO")
find_package(c-ares QUIET CONFIG)
if(NOT c-ares_FOUND)
if(c-ares_FOUND)
set(CARES_INCLUDE_DIR ${c-ares_INCLUDE_DIR})
else()
build_cares()
endif()
elseif(c-ares_SOURCE STREQUAL "BUNDLED")
build_cares()
elseif(c-ares_SOURCE STREQUAL "SYSTEM")
find_package(c-ares REQUIRED CONFIG)
set(CARES_INCLUDE_DIR ${c-ares_INCLUDE_DIR})
endif()

# TODO: Don't use global includes but rather target_include_directories
get_target_property(CARES_INCLUDE_DIR c-ares::cares INTERFACE_INCLUDE_DIRECTORIES)
include_directories(SYSTEM ${CARES_INCLUDE_DIR})
endif()

Expand Down

0 comments on commit e16da50

Please sign in to comment.