cmake: Apply workaround for install_name_tool conditionally

This commit is contained in:
Hennadii Stepanov 2026-02-14 10:55:45 +00:00
parent b65ff0e5a1
commit 80dc4359b8
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -69,8 +69,13 @@ set(CLIENT_BUGREPORT "https://github.com/bitcoin/bitcoin/issues")
#=============================
# Language setup
#=============================
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE)
if(CMAKE_VERSION VERSION_LESS 4.2 AND CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE)
# We do not use the install_name_tool when cross-compiling for macOS.
# However, CMake < 4.2 still searches for Apple's version of the tool,
# which causes an error during configuration.
# See:
# - https://gitlab.kitware.com/cmake/cmake/-/issues/27069
# - https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10955
# So disable this tool check in further enable_language() commands.
set(CMAKE_PLATFORM_HAS_INSTALLNAME FALSE)
endif()