Skip to content

Commit

Permalink
Apply orc patch in order to make CMake happy
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd committed Jul 26, 2024
1 parent a60bc06 commit 982a6ce
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4494,9 +4494,12 @@ function(build_orc)
message(STATUS "Building Apache ORC from source")

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
find_program(PATCH patch REQUIRED)
set(ORC_PATCH_COMMAND ${PATCH} -p1 -i ${CMAKE_CURRENT_LIST_DIR}/orc.diff)
fetchcontent_declare(orc
${FC_DECLARE_COMMON_OPTIONS}
URL ${ORC_SOURCE_URL}
PATCH_COMMAND ${ORC_PATCH_COMMAND}
URL_HASH "SHA256=${ARROW_ORC_BUILD_SHA256_CHECKSUM}")
prepare_fetchcontent()

Expand Down
30 changes: 30 additions & 0 deletions cpp/cmake_modules/orc.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
index aa520ff..1acdbd0 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -464,8 +464,10 @@ add_library (orc::protoc ALIAS orc_protoc)

if (ORC_PACKAGE_KIND STREQUAL "conan")
target_link_libraries (orc_protobuf INTERFACE ${protobuf_LIBRARIES})
-elseif (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOBUF_STATIC_LIB})
- target_link_libraries (orc_protobuf INTERFACE ${PROTOBUF_STATIC_LIB})
+elseif (ORC_PREFER_STATIC_PROTOBUF)
+ if (${PROTOBUF_STATIC_LIB})
+ target_link_libraries (orc_protobuf INTERFACE ${PROTOBUF_STATIC_LIB})
+ endif()
else ()
target_link_libraries (orc_protobuf INTERFACE ${PROTOBUF_LIBRARY})
endif()
@@ -476,8 +478,10 @@ else ()
endif ()

if (NOT ORC_PACKAGE_KIND STREQUAL "conan")
- if (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOC_STATIC_LIB})
- target_link_libraries (orc_protoc INTERFACE ${PROTOC_STATIC_LIB})
+ if (${ORC_PREFER_STATIC_PROTOBUF})
+ if (${PROTOC_STATIC_LIB})
+ target_link_libraries (orc_protoc INTERFACE ${PROTOC_STATIC_LIB})
+ endif()
else ()
target_link_libraries (orc_protoc INTERFACE ${PROTOC_LIBRARY})
endif()

0 comments on commit 982a6ce

Please sign in to comment.