From 80dc4359b8a1580341c22a91d4fc42daa6ce10eb Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 14 Feb 2026 10:55:45 +0000 Subject: [PATCH 1/2] cmake: Apply workaround for `install_name_tool` conditionally --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f992a8d6af4..8d5a5dd263f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() From 38a7a6712663b52a40210374334c7427bc776cf4 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 14 Feb 2026 11:17:04 +0000 Subject: [PATCH 2/2] cmake: Provide `install_name_tool` stub instead of disabling it When running `enable_language()`, CMake checks the platform-specific toolchain components, which includes `install_name_tool` for macOS. We disable this check when cross-compiling on Linux because `install_name_tool` is not used and our toolchain file does not provide it. However, the current workaround has been breaking CMake's assumptions since commit eb8facd39606e9472f9ff6de40d7caf76767d0da (CMake 4.1.0, backported to 4.0.5), which causes an error during configuration using the Ninja generator. This change fixes this behaviour by providing a stub executable instead of `install_name_tool`, as we currently do in the depends build subsystem. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d5a5dd263f..66d4112f9ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ if(CMAKE_VERSION VERSION_LESS 4.2 AND CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NO # - 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) + set(CMAKE_INSTALL_NAME_TOOL "${CMAKE_COMMAND} -E true") endif() enable_language(CXX) set(CMAKE_CXX_STANDARD 20)