Skip to content

Commit

Permalink
fix(c++): fix link error -lgar_arrow_static not found when link stati…
Browse files Browse the repository at this point in the history
…c graphar build arrow from source

Signed-off-by: acezen <[email protected]>
  • Loading branch information
acezen committed Sep 12, 2024
1 parent c260513 commit 80518bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,17 @@ macro(build_graphar_with_arrow_bundled)
target_link_libraries(graphar PRIVATE ${CMAKE_DL_LIBS})

if(APPLE)
message(STATUS "Linking arrow bundled dependencies " ${GAR_PARQUET_STATIC_LIB} ${GAR_ACERO_STATIC_LIB})
target_link_libraries(graphar PRIVATE -Wl,-force_load gar_arrow_static
target_link_libraries(graphar PRIVATE -Wl,-force_load
"${GAR_ARROW_STATIC_LIB}"
"${GAR_PARQUET_STATIC_LIB}"
"${GAR_DATASET_STATIC_LIB}"
"${GAR_ARROW_ACERO_STATIC_LIB}"
"${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB}"
"-framework CoreFoundation"
"-framework Security")
else()
target_link_libraries(graphar PRIVATE -Wl,--exclude-libs,ALL -Wl,--whole-archive gar_arrow_static
target_link_libraries(graphar PRIVATE -Wl,--exclude-libs,ALL -Wl,--whole-archive
"${GAR_ARROW_STATIC_LIB}"
"${GAR_PARQUET_STATIC_LIB}"
"${GAR_DATASET_STATIC_LIB}"
"${GAR_ARROW_ACERO_STATIC_LIB}"
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake/apache-arrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function(build_arrow)

set(GAR_ARROW_STATIC_LIB_FILENAME
"${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(GAR_ARROW_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}")
set(GAR_ARROW_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow lib")
set(GAR_PARQUET_STATIC_LIB_FILENAME
"${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(GAR_PARQUET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}" CACHE INTERNAL "parquet lib")
Expand Down

0 comments on commit 80518bc

Please sign in to comment.