Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
Comment thread
willcl-ark marked this conversation as resolved.
Outdated
set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations")

# The following is only necessary when using cmake from Nix or NixOS, because
# Nix patches cmake to remove the root directory `/` from
# CMAKE_SYSTEM_PREFIX_PATH. Adding it back is harmless on other platforms and
# necessary on Nix because without it cmake find_path, find_package, etc
# functions do not know where to look in CMAKE_FIND_ROOT_PATH for dependencies
# (https://github.com/bitcoin/bitcoin/issues/32428).
Comment on lines +97 to +100

@hebasto hebasto Jun 24, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be precise, "Adding it back ... on other platforms" does not occur on every other platform that supports our depends build subsystem. According to the CMake source code, Platform/UnixPaths is processed on all platforms: Linux, Darwin, and all *BSD.

#
# TODO: longer term, it may be possible to use a dependency provider, which
# would bring the find_package calls completely under our control, making this
# patch unnecessary.
#
# Make sure we only append once, as this file may be called repeatedly.
if(NOT "/" IN_LIST CMAKE_PREFIX_PATH)
list(APPEND CMAKE_PREFIX_PATH "/")
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE)
# The find_package(Qt ...) function internally uses find_library()
# calls for all dependencies to ensure their availability.
Expand Down
Loading