lidavidm commented on pull request #11889:
URL: https://github.com/apache/arrow/pull/11889#issuecomment-988275175
This diff gets CMake to repeat `libarrow.a` after `libarrow_flight.a`, so we
don't have to order the Arrow libraries ourselves in our "consumer"
CMakeLists.txt:
```diff
diff --git a/cpp/src/arrow/flight/CMakeLists.txt
b/cpp/src/arrow/flight/CMakeLists.txt
index 8a3228e50..846a420f9 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt
+++ b/cpp/src/arrow/flight/CMakeLists.txt
@@ -170,7 +170,9 @@ add_arrow_lib(arrow_flight
${ARROW_FLIGHT_LINK_LIBS}
STATIC_LINK_LIBS
arrow_static
- ${ARROW_FLIGHT_LINK_LIBS})
+ ${ARROW_FLIGHT_LINK_LIBS}
+ STATIC_INSTALL_INTERFACE_LIBS
+ arrow_static)
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)
```
And this additional diff, while questionable, fixes the rest of the link
errors:
```diff
diff --git a/cpp/src/arrow/ArrowConfig.cmake.in
b/cpp/src/arrow/ArrowConfig.cmake.in
index 6209baeec..750d3aba6 100644
--- a/cpp/src/arrow/ArrowConfig.cmake.in
+++ b/cpp/src/arrow/ArrowConfig.cmake.in
@@ -87,6 +87,10 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
set_target_properties(
arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
+ # Propagate dependencies like OpenSSL
+ set_target_properties(
+ arrow_bundled_dependencies PROPERTIES INTERFACE_LINK_LIBRARIES
+ "${arrow_static_interface_link_libraries}")
endif()
endif()
endif()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]