This is an automated email from the ASF dual-hosted git repository.

changchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new acb1bbf426 [GLUTEN-9526][CH] Add cmake option to create symbol instead 
of rename (#9527)
acb1bbf426 is described below

commit acb1bbf426b524ad97998ee7a47a72bc6d7f2abd
Author: Chang chen <[email protected]>
AuthorDate: Tue May 6 20:41:26 2025 +0800

    [GLUTEN-9526][CH] Add cmake option to create symbol instead of rename 
(#9527)
    
    * [GLUTEN-9526][CH] Add cmake option to create symbol instead of rename
    
    * fix sytle
    
    * fix sytle
    
    ---------
    
    Co-authored-by: Chang chen <[email protected]>
---
 cpp-ch/local-engine/CMakeLists.txt | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/cpp-ch/local-engine/CMakeLists.txt 
b/cpp-ch/local-engine/CMakeLists.txt
index 4be2bdbc38..1d4654bcae 100644
--- a/cpp-ch/local-engine/CMakeLists.txt
+++ b/cpp-ch/local-engine/CMakeLists.txt
@@ -115,6 +115,8 @@ target_link_libraries(
   PUBLIC substrait_source clickhouse_aggregate_functions clickhouse_functions
          gluten_spark_functions ch_contrib::xxHash)
 
+option(USE_SYMLINK "Use symlink instead of rename for library" OFF)
+
 # Add udf sources files in sub directories to functions_sources
 option(ENABLE_LOCAL_UDFS
        "Build UDFs in 'local-engine/Parser/*_udf' subdirectories" ON)
@@ -200,13 +202,24 @@ if(ENABLE_SEPARATE_SYMBOLS)
   separate_symbols(${LOCALENGINE_SHARED_LIB})
 endif()
 
-add_custom_command(
-  OUTPUT ${LOCALENGINE_SHARED_LIB_NAME}
-  COMMAND ${CMAKE_COMMAND} -E rename $<TARGET_FILE:${LOCALENGINE_SHARED_LIB}>
-          ${LOCALENGINE_SHARED_LIB_NAME}
-  COMMENT
-    "Renaming $<TARGET_FILE:${LOCALENGINE_SHARED_LIB}> to 
${LOCALENGINE_SHARED_LIB_NAME}"
-  DEPENDS ${LOCALENGINE_SHARED_LIB})
+if(USE_SYMLINK)
+  add_custom_command(
+    OUTPUT ${LOCALENGINE_SHARED_LIB_NAME}
+    COMMAND
+      ${CMAKE_COMMAND} -E create_symlink
+      $<TARGET_FILE:${LOCALENGINE_SHARED_LIB}> ${LOCALENGINE_SHARED_LIB_NAME}
+    COMMENT
+      "Creating symlink from $<TARGET_FILE:${LOCALENGINE_SHARED_LIB}> to 
${LOCALENGINE_SHARED_LIB_NAME}"
+    DEPENDS ${LOCALENGINE_SHARED_LIB})
+else()
+  add_custom_command(
+    OUTPUT ${LOCALENGINE_SHARED_LIB_NAME}
+    COMMAND ${CMAKE_COMMAND} -E rename $<TARGET_FILE:${LOCALENGINE_SHARED_LIB}>
+            ${LOCALENGINE_SHARED_LIB_NAME}
+    COMMENT
+      "Renaming $<TARGET_FILE:${LOCALENGINE_SHARED_LIB}> to 
${LOCALENGINE_SHARED_LIB_NAME}"
+    DEPENDS ${LOCALENGINE_SHARED_LIB})
+endif()
 
 add_custom_target(libch ALL DEPENDS ${LOCALENGINE_SHARED_LIB_NAME})
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to