Skip to content

Commit 9ec7123

Browse files
raulcdkou
authored andcommitted
Manually link lz4, snappy, zstd and zlib if orcAlt_FOUND.
1 parent 5fce163 commit 9ec7123

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cpp/cmake_modules/FindorcAlt.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,28 @@ find_package_handle_standard_args(
6666

6767
if(orcAlt_FOUND)
6868
if(NOT TARGET orc::orc)
69+
# For old Apache Orc. For example, apache-orc 2.0.3 on Alpine
70+
# Linux 3.20 and 3.21.
6971
add_library(orc::orc STATIC IMPORTED)
7072
set_target_properties(orc::orc
7173
PROPERTIES IMPORTED_LOCATION "${ORC_STATIC_LIB}"
7274
INTERFACE_INCLUDE_DIRECTORIES "${ORC_INCLUDE_DIR}")
75+
if(ARROW_WITH_LZ4 AND TARGET LZ4::lz4)
76+
target_link_libraries(orc::orc INTERFACE LZ4::lz4)
77+
endif()
78+
if(ARROW_WITH_SNAPPY AND TARGET Snappy::snappy)
79+
target_link_libraries(orc::orc INTERFACE Snappy::snappy)
80+
endif()
81+
if(ARROW_WITH_ZSTD)
82+
if(TARGET zstd::libzstd_shared)
83+
target_link_libraries(orc::orc INTERFACE zstd::libzstd_shared)
84+
elseif(TARGET zstd::libzstd_static)
85+
target_link_libraries(orc::orc INTERFACE zstd::libzstd_static)
86+
endif()
87+
endif()
88+
if(ARROW_WITH_ZLIB AND TARGET ZLIB::ZLIB)
89+
target_link_libraries(orc::orc INTERFACE ZLIB::ZLIB)
90+
endif()
7391
endif()
7492
set(orcAlt_VERSION ${ORC_VERSION})
7593
endif()

0 commit comments

Comments
 (0)