@@ -1018,22 +1018,20 @@ if(ARROW_ORC)
10181018 arrow_add_object_library (ARROW_ORC adapters/orc/adapter.cc adapters/orc/options.cc
10191019 adapters/orc/util.cc )
10201020 foreach (ARROW_ORC_TARGET ${ARROW_ORC_TARGETS} )
1021- target_link_libraries (${ARROW_ORC_TARGET} PRIVATE orc::orc )
1021+ # Link ORC as PUBLIC so that orc.lib and its dependencies (protobuf)
1022+ # propagate to the consuming target (arrow_shared). PRIVATE deps of
1023+ # OBJECT libraries are not propagated on MSVC, which causes unresolved
1024+ # protobuf symbols when linking arrow.dll.
1025+ if (MSVC )
1026+ target_link_libraries (${ARROW_ORC_TARGET} PUBLIC orc::orc )
1027+ else ()
1028+ target_link_libraries (${ARROW_ORC_TARGET} PRIVATE orc::orc )
1029+ endif ()
10221030 if (ARROW_ORC_VERSION VERSION_LESS "2.0.0" )
10231031 target_compile_definitions (${ARROW_ORC_TARGET}
10241032 PRIVATE ARROW_ORC_NEED_TIME_ZONE_DATABASE_CHECK )
10251033 endif ()
10261034 endforeach ()
1027- # On Windows (MSVC), ORC links protobuf PRIVATE so protobuf symbols
1028- # don't propagate through the OBJECT library chain to arrow.dll.
1029- # Add protobuf directly to ensure it appears on the link line.
1030- if (MSVC )
1031- list (APPEND ARROW_SHARED_PRIVATE_LINK_LIBS ${ARROW_PROTOBUF_LIBPROTOBUF} )
1032- endif ()
1033- message (STATUS "DEBUG ORC: MSVC=${MSVC } " )
1034- message (STATUS "DEBUG ORC: ARROW_PROTOBUF_LIBPROTOBUF=${ARROW_PROTOBUF_LIBPROTOBUF} " )
1035- message (STATUS "DEBUG ORC: ARROW_SHARED_PRIVATE_LINK_LIBS=${ARROW_SHARED_PRIVATE_LINK_LIBS} "
1036- )
10371035else ()
10381036 set (ARROW_ORC_TARGET_SHARED)
10391037 set (ARROW_ORC_TARGET_STATIC)
@@ -1106,9 +1104,6 @@ else()
11061104 set (ARROW_PC_REQUIRES "" )
11071105endif ()
11081106
1109- message (STATUS "DEBUG ARROW_LIB: ARROW_SHARED_PRIVATE_LINK_LIBS=${ARROW_SHARED_PRIVATE_LINK_LIBS} "
1110- )
1111- message (STATUS "DEBUG ARROW_LIB: ARROW_ORC_TARGET_SHARED=${ARROW_ORC_TARGET_SHARED} " )
11121107add_arrow_lib (arrow
11131108 CMAKE_PACKAGE_NAME
11141109 Arrow
0 commit comments