Elssky commented on code in PR #657:
URL: https://github.com/apache/incubator-graphar/pull/657#discussion_r1836117409


##########
cpp/CMakeLists.txt:
##########
@@ -231,21 +319,40 @@ macro(build_graphar_with_arrow_bundled)
     target_include_directories(graphar SYSTEM BEFORE PRIVATE 
${GAR_ARROW_INCLUDE_DIR})
     target_link_libraries(graphar PRIVATE ${CMAKE_DL_LIBS})
 
+    set(GAR_BUNDLED_DEPS_STATIC_LIBS)
+    list(APPEND GAR_BUNDLED_DEPS_STATIC_LIBS
+        gar_arrow_static
+        gar_parquet_static
+        gar_dataset_static
+        gar_acero_static
+        gar_arrow_bundled_dependencies_static)
+    graphar_car(_FIRST_LIB ${GAR_BUNDLED_DEPS_STATIC_LIBS})
+    graphar_cdr(_OTHER_LIBS ${GAR_BUNDLED_DEPS_STATIC_LIBS})
+
+    graphar_create_merged_static_lib(graphar_bundled_dependencies
+                                    NAME
+                                    graphar_bundled_dependencies
+                                    ROOT
+                                    ${_FIRST_LIB}
+                                    TO_MERGE
+                                    ${_OTHER_LIBS})
+    # We can't use install(TARGETS) here because
+    # graphar_bundled_dependencies is an IMPORTED library.
+    get_target_property(graphar_bundled_dependencies_path 
graphar_bundled_dependencies
+                        IMPORTED_LOCATION)
+    install(FILES ${CMAKE_BINARY_DIR}/${graphar_bundled_dependencies_path} 
${INSTALL_IS_OPTIONAL}
+            DESTINATION ${CMAKE_INSTALL_LIBDIR})
+    string(APPEND ARROW_PC_LIBS_PRIVATE " -lgraphar_bundled_dependencies")
+    list(INSERT ARROW_STATIC_INSTALL_INTERFACE_LIBS 0 
"graphar_bundled_dependencies")
+
     if(APPLE)
-        message(STATUS "Linking arrow bundled dependencies " 
${GAR_PARQUET_STATIC_LIB} ${GAR_ACERO_STATIC_LIB})
-        target_link_libraries(graphar PRIVATE -Wl,-force_load gar_arrow_static
-                "${GAR_PARQUET_STATIC_LIB}"
-                "${GAR_DATASET_STATIC_LIB}"
-                "${GAR_ARROW_ACERO_STATIC_LIB}"
-                "${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB}"
+        target_link_libraries(graphar PRIVATE -Wl,-force_load
+                graphar_bundled_dependencies
                 "-framework CoreFoundation"
                 "-framework Security")
     else()
-        target_link_libraries(graphar PRIVATE -Wl,--exclude-libs,ALL 
-Wl,--whole-archive gar_arrow_static
-                "${GAR_PARQUET_STATIC_LIB}"
-                "${GAR_DATASET_STATIC_LIB}"
-                "${GAR_ARROW_ACERO_STATIC_LIB}"
-                "${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB}" -Wl,--no-whole-archive) 
+        target_link_libraries(graphar PRIVATE -Wl,--exclude-libs,ALL

Review Comment:
   remove `-Wl,--whole-archive` and  `-Wl,--no-whole-archive`



-- 
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: commits-unsubscr...@graphar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@graphar.apache.org
For additional commands, e-mail: commits-h...@graphar.apache.org

Reply via email to