Skip to content

Set RERUN_ARROW_LINK_SHARED_DEFAULT based on found Arrow build #9550

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

Merged
merged 2 commits into from
Apr 10, 2025
Merged
Changes from 1 commit
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
16 changes: 12 additions & 4 deletions rerun_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,24 @@ target_link_libraries(rerun_sdk PRIVATE rerun_c)
# Arrow dependency.
# This makes the setup a lot easier on Windows where we otherwise need to put Arrow.dll either in path or copy it with the executable.
# Additionally reduces risk of picking up system libraries on Mac / Linux.
set(RERUN_ARROW_LINK_SHARED_DEFAULT OFF)
option(RERUN_ARROW_LINK_SHARED "Link to the Arrow shared library." ${RERUN_ARROW_LINK_SHARED_DEFAULT})
option(RERUN_DOWNLOAD_AND_BUILD_ARROW "If enabled, arrow will be added as an external project and built with the minimal set required by the Rerun C++ SDK" ON)

if (NOT RERUN_DOWNLOAD_AND_BUILD_ARROW)
find_package(Arrow REQUIRED)
endif()

if (ARROW_BUILD_SHARED)
set(RERUN_ARROW_LINK_SHARED_DEFAULT ON)
else()
set(RERUN_ARROW_LINK_SHARED_DEFAULT OFF)
endif()

option(RERUN_ARROW_LINK_SHARED "Link to the Arrow shared library." ${RERUN_ARROW_LINK_SHARED_DEFAULT})

if(RERUN_DOWNLOAD_AND_BUILD_ARROW)
include(download_and_build_arrow.cmake)
download_and_build_arrow() # populates `rerun_arrow_target`
else()
find_package(Arrow REQUIRED)

if(RERUN_ARROW_LINK_SHARED)
add_library(rerun_arrow_target ALIAS Arrow::arrow_shared)
else()
Expand Down
Loading