Skip to content

Commit

Permalink
apacheGH-38063: [C++] Use absolute path for external project's ar/ranlib
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 6, 2023
1 parent 1084382 commit c0ac176
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -921,11 +921,15 @@ set(EP_COMMON_TOOLCHAIN "-DCMAKE_C_COMPILER=${EP_C_COMPILER}"
"-DCMAKE_CXX_COMPILER=${EP_CXX_COMPILER}")

if(CMAKE_AR)
list(APPEND EP_COMMON_TOOLCHAIN -DCMAKE_AR=${CMAKE_AR})
# Ensure using absolute path.
find_program(EP_CMAKE_AR ${CMAKE_AR} REQUIRED)
list(APPEND EP_COMMON_TOOLCHAIN -DCMAKE_AR=${EP_CMAKE_AR})
endif()

if(CMAKE_RANLIB)
list(APPEND EP_COMMON_TOOLCHAIN -DCMAKE_RANLIB=${CMAKE_RANLIB})
# Ensure using absolute path.
find_program(EP_CMAKE_RANLIB ${CMAKE_RANLIB} REQUIRED)
list(APPEND EP_COMMON_TOOLCHAIN -DCMAKE_RANLIB=${EP_CMAKE_RANLIB})
endif()

# External projects are still able to override the following declarations.
Expand Down

0 comments on commit c0ac176

Please sign in to comment.