Skip to content

Commit 7700dd4

Browse files
authored
GH-47748: [C++][Dataset] Fix link error on macOS (#47749)
### Rationale for this change There are link errors with build options for JNI on macOS. ### What changes are included in this PR? `ARROW_BUNDLED_STATIC_LIBS` has CMake target names defined in Apache Arrow not `find_package()`-ed target names. So we should use `aws-c-common` not `AWS::aws-c-common`. Recent aws-c-common or something use the Network framework. So add `Network` to `Arrow::arrow_bundled_dependencies` dependencies. Don't use `compute/kernels/temporal_internal.cc` in `libarrow.dylib` and `libarrow_compute.dylib` to avoid duplicated symbols error. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: #47748 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 8e3d849 commit 7700dd4

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

cpp/src/arrow/ArrowConfig.cmake.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ if(TARGET Arrow::arrow_static AND NOT TARGET Arrow::arrow_bundled_dependencies)
124124
# https://cmake.org/cmake/help/latest/policy/CMP0057.html
125125
cmake_policy(PUSH)
126126
cmake_policy(SET CMP0057 NEW)
127-
if("AWS::aws-c-common" IN_LIST ARROW_BUNDLED_STATIC_LIBS)
127+
if("aws-c-common" IN_LIST ARROW_BUNDLED_STATIC_LIBS)
128128
if(APPLE)
129129
find_library(CORE_FOUNDATION CoreFoundation)
130130
target_link_libraries(Arrow::arrow_bundled_dependencies
131131
INTERFACE ${CORE_FOUNDATION})
132+
find_library(NETWORK Network)
133+
target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE ${NETWORK})
132134
find_library(SECURITY Security)
133135
target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE ${SECURITY})
134136
elseif(WIN32)

cpp/src/arrow/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,6 @@ if(ARROW_COMPUTE)
780780
compute/kernels/scalar_temporal_binary.cc
781781
compute/kernels/scalar_temporal_unary.cc
782782
compute/kernels/scalar_validity.cc
783-
compute/kernels/temporal_internal.cc
784783
compute/kernels/util_internal.cc
785784
compute/kernels/vector_array_sort.cc
786785
compute/kernels/vector_cumulative_ops.cc

cpp/src/arrow/compute/kernels/temporal_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ inline int64_t GetQuarter(const year_month_day& ymd) {
8080
return static_cast<int64_t>((static_cast<uint32_t>(ymd.month()) - 1) / 3);
8181
}
8282

83-
Result<ArrowTimeZone> LocateZone(const std::string_view timezone);
83+
ARROW_EXPORT Result<ArrowTimeZone> LocateZone(const std::string_view timezone);
8484

8585
static inline const std::string& GetInputTimezone(const DataType& type) {
8686
static const std::string no_timezone = "";

cpp/src/arrow/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ if needs_compute
525525
'compute/kernels/scalar_temporal_binary.cc',
526526
'compute/kernels/scalar_temporal_unary.cc',
527527
'compute/kernels/scalar_validity.cc',
528-
'compute/kernels/temporal_internal.cc',
529528
'compute/kernels/util_internal.cc',
530529
'compute/kernels/vector_array_sort.cc',
531530
'compute/kernels/vector_cumulative_ops.cc',

0 commit comments

Comments
 (0)