pitrou commented on code in PR #45618:
URL: https://github.com/apache/arrow/pull/45618#discussion_r2053765398


##########
cpp/src/arrow/compute/CMakeLists.txt:
##########
@@ -81,11 +86,36 @@ function(ADD_ARROW_COMPUTE_TEST REL_TEST_NAME)
     set(LABELS ${ARROW_COMPUTE_TEST_LABELS})
   endif()
 
+  if(WIN32)
+    if(MSVC)
+      set(EXTRA_LINK_LIBS arrow_compute_shared)
+      set(EXTRA_LINK_OPTIONS "/WHOLEARCHIVE:arrow_compute_shared")
+    else()
+      set(EXTRA_LINK_LIBS "-Wl,--whole-archive" arrow_compute_shared
+                          "-Wl,--allow-multiple-definition" 
"-Wl,--no-whole-archive")
+    endif()
+  elseif(APPLE)
+    set(EXTRA_LINK_LIBS "-Wl,-force_load" arrow_compute_shared)
+  else()
+    set(EXTRA_LINK_LIBS "-Wl,--push-state,--no-as-needed" arrow_compute_shared
+                        "-Wl,--pop-state")
+  endif()
+
+  if(ARG_EXTRA_LINK_LIBS)
+    list(APPEND EXTRA_LINK_LIBS ${ARG_EXTRA_LINK_LIBS})
+  endif()

Review Comment:
   > At this point I think the explicit function call to 
`RegisterComputeKernels` is a better approach as it's much simpler from a user 
stand-point.
   
   Well, that's a good point. I wasn't aware that using a static initializer 
would have such pitfalls.



-- 
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: github-unsubscr...@arrow.apache.org

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

Reply via email to