fix(apps/wallet): use @loader_path rpath for the QML plugin on macOS

The Logos.Wallet QML plugin was installed with an ELF "$ORIGIN" rpath.
macOS dyld does not expand "$ORIGIN", so loading the plugin failed with

  Cannot load library liblogos_wallet_qmlplugin.dylib:
  Library not loaded: @rpath/liblogos_wallet_qml.dylib

even though liblogos_wallet_qml.dylib sits in the same directory. Select
the rpath per platform: @loader_path on Apple, $ORIGIN elsewhere, so
@rpath/liblogos_wallet_qml.dylib resolves to the sibling library.
This commit is contained in:
r4bbit 2026-07-16 14:44:20 +02:00
parent d47cc70ce7
commit c0947e1917
No known key found for this signature in database
GPG Key ID: E95F1E9447DC91A9

View File

@ -106,11 +106,18 @@ if(LOGOS_WALLET_BUILD_QML)
Qt6::Quick
Qt6::QuickControls2
)
# Resolve the sibling liblogos_wallet_qml.dylib/.so next to the plugin.
# macOS dyld does not expand the ELF "$ORIGIN" token it uses @loader_path.
if(APPLE)
set(wallet_qml_rpath "@loader_path")
else()
set(wallet_qml_rpath "$ORIGIN")
endif()
set_target_properties(logos_wallet_qml logos_wallet_qmlplugin PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${wallet_qml_output_dir}"
RUNTIME_OUTPUT_DIRECTORY "${wallet_qml_output_dir}"
BUILD_WITH_INSTALL_RPATH ON
INSTALL_RPATH "$ORIGIN"
INSTALL_RPATH "${wallet_qml_rpath}"
)
set(wallet_qml_install_dir "lib/qml/Logos/Wallet")