You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2023/06/21 02:45:48 UTC

[arrow] branch main updated: GH-36117: [C++] Ensure creating BUILD_OUTPUT_ROOT_DIRECTORY (#36160)

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

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7513a3ed68 GH-36117: [C++] Ensure creating BUILD_OUTPUT_ROOT_DIRECTORY (#36160)
7513a3ed68 is described below

commit 7513a3ed681d862200ce2fc3e476fef92d07c4be
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Wed Jun 21 11:45:41 2023 +0900

    GH-36117: [C++] Ensure creating BUILD_OUTPUT_ROOT_DIRECTORY (#36160)
    
    ### Rationale for this change
    
    If it doesn't exist when we build arrow_bundled_dependencies.lib, "lib.exe ..." failed.
    
    ### What changes are included in this PR?
    
    Ensure creating it in `cmake ...` phase not build phrase.
    
    This also includes cleanup of lib.exe detection related codes but it's not related of this fix. Sorry. "file(MAKE_DIRECTORY)" is only important.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    Yes.
    * Closes: #36117
    
    Authored-by: Sutou Kouhei <ko...@clear-code.com>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 cpp/cmake_modules/BuildUtils.cmake | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index 03052fb4ec..72cb234b4f 100644
--- a/cpp/cmake_modules/BuildUtils.cmake
+++ b/cpp/cmake_modules/BuildUtils.cmake
@@ -86,6 +86,7 @@ function(arrow_create_merged_static_lib output_target)
     message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
   endif()
 
+  file(MAKE_DIRECTORY ${BUILD_OUTPUT_ROOT_DIRECTORY})
   set(output_lib_path
       ${BUILD_OUTPUT_ROOT_DIRECTORY}${CMAKE_STATIC_LIBRARY_PREFIX}${ARG_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
   )
@@ -121,15 +122,14 @@ function(arrow_create_merged_static_lib output_target)
     set(BUNDLE_COMMAND ${ar_tool} -M < ${ar_script_path})
 
   elseif(MSVC)
-    if(NOT CMAKE_LIBTOOL)
-      find_program(lib_tool lib HINTS "${CMAKE_CXX_COMPILER}/..")
-      if("${lib_tool}" STREQUAL "lib_tool-NOTFOUND")
-        message(FATAL_ERROR "Cannot locate libtool to bundle libraries")
-      endif()
+    if(CMAKE_LIBTOOL)
+      set(BUNDLE_TOOL ${CMAKE_LIBTOOL})
     else()
-      set(${lib_tool} ${CMAKE_LIBTOOL})
+      find_program(BUNDLE_TOOL lib HINTS "${CMAKE_CXX_COMPILER}/..")
+      if(NOT BUNDLE_TOOL)
+        message(FATAL_ERROR "Cannot locate lib.exe to bundle libraries")
+      endif()
     endif()
-    set(BUNDLE_TOOL ${lib_tool})
     set(BUNDLE_COMMAND ${BUNDLE_TOOL} /NOLOGO /OUT:${output_lib_path}
                        ${all_library_paths})
   else()