kou commented on a change in pull request #11889:
URL: https://github.com/apache/arrow/pull/11889#discussion_r765264031



##########
File path: 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}")

Review comment:
       I see. Then we should list OpenSSL in `INTERFACE_LINK_LIBRARIES` of 
`arrow_bundled_dependencies` not `arrow_static` and `INTERFACE_LINK_LIBRARIES` 
of `arrow_static` should list only `arrow_bundled_dependencies` something like 
this:
   
   ```diff
   diff --git a/cpp/src/arrow/ArrowConfig.cmake.in 
b/cpp/src/arrow/ArrowConfig.cmake.in
   index 6209baeec..ac2b9a027 100644
   --- a/cpp/src/arrow/ArrowConfig.cmake.in
   +++ b/cpp/src/arrow/ArrowConfig.cmake.in
   @@ -38,6 +38,7 @@ set(ARROW_LIBRARY_PATH_SUFFIXES 
"@ARROW_LIBRARY_PATH_SUFFIXES@")
    set(ARROW_INCLUDE_PATH_SUFFIXES "@ARROW_INCLUDE_PATH_SUFFIXES@")
    set(ARROW_SYSTEM_DEPENDENCIES "@ARROW_SYSTEM_DEPENDENCIES@")
    set(ARROW_BUNDLED_STATIC_LIBS "@ARROW_BUNDLED_STATIC_LIBS@")
   +set(ARROW_STATIC_INSTALL_INTERFACE_LIBS 
"@ARROW_STATIC_INSTALL_INTERFACE_LIBS@")
    
    include("${CMAKE_CURRENT_LIST_DIR}/ArrowOptions.cmake")
    
   @@ -79,14 +80,9 @@ if(NOT (TARGET arrow_shared OR TARGET arrow_static))
            PROPERTIES
              IMPORTED_LOCATION
              
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
   +          INTERFACE_LINK_LIBRARIES
   +          "${ARROW_STATIC_INSTALL_INTERFACE_LIBS}"
            )
   -
   -      get_property(arrow_static_interface_link_libraries
   -                  TARGET arrow_static
   -                  PROPERTY INTERFACE_LINK_LIBRARIES)
   -      set_target_properties(
   -        arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES
   -        
"${arrow_static_interface_link_libraries};arrow_bundled_dependencies")
        endif()
      endif()
    endif()
   diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
   index 5736c557b..66a24fbfc 100644
   --- a/cpp/src/arrow/CMakeLists.txt
   +++ b/cpp/src/arrow/CMakeLists.txt
   @@ -526,6 +526,9 @@ endif()
    
    if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
      string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
   +  set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL "arrow_bundled_dependencies")
   +else()
   +  set(ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL 
${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
    endif()
    # Need -latomic on Raspbian.
    # See also: https://issues.apache.org/jira/browse/ARROW-12860
   @@ -557,7 +560,7 @@ add_arrow_lib(arrow
                  SHARED_INSTALL_INTERFACE_LIBS
                  ${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
                  STATIC_INSTALL_INTERFACE_LIBS
   -              ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
   +              ${ARROW_STATIC_INSTALL_INTERFACE_LIBS_REAL})
    
    add_dependencies(arrow ${ARROW_LIBRARIES})
    
   ```




-- 
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]


Reply via email to