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 ee89232
Show file tree
Hide file tree
Showing 2 changed files with 25 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
22 changes: 22 additions & 0 deletions cpp/cmake_modules/orc.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
index aa520ff..01ab294 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -464,7 +464,7 @@ 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})
+elseif (ORC_PREFER_STATIC_PROTOBUF AND DEFINED PROTOBUF_STATIC_LIB)
target_link_libraries (orc_protobuf INTERFACE ${PROTOBUF_STATIC_LIB})
else ()
target_link_libraries (orc_protobuf INTERFACE ${PROTOBUF_LIBRARY})
@@ -476,7 +476,7 @@ else ()
endif ()

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

0 comments on commit ee89232

Please sign in to comment.