Skip to content

[C++] Explicitly providing CMAKE_LIBTOOL does not work on MacOS #49974

Description

@jabraham17

Describe the bug, including details regarding any error messages, version, and platform.

I found that when explicitly specifying -DCMAKE_LIBTOOL=/usr/bin/libtool on MacOS the build fails with

cmake_modules/BuildUtils.cmake:123 (message):
CMAKE_LIBTOOL does not appear to be Apple's libtool: /usr/bin/libtool

libtool -V output: Apple Inc. version cctools_ld-1266.8
Call Stack (most recent call first):
src/arrow/CMakeLists.txt:1047 (arrow_create_merged_static_lib)

I think this is an issue with validate_apple_libtool in cpp/cmake_modules/BuildUtils.cmake, where result_var is not set to true if the version does match

Changing the function to the following seems to work for me (adding the else branch)

    function(validate_apple_libtool result_var item)
      get_libtool_version("${item}" libtool_version)
      if(NOT "${libtool_version}" MATCHES ".*cctools.+([0-9.]+).*")
        set(${result_var}
            FALSE
            PARENT_SCOPE)
      else()
        set(${result_var}
            TRUE
            PARENT_SCOPE)
      endif()
    endfunction()

Component(s)

C++

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions