From c0947e1917c38e4c2ed52ad87b2bb61263a503e3 Mon Sep 17 00:00:00 2001 From: r4bbit <445106+0x-r4bbit@users.noreply.github.com> Date: Thu, 16 Jul 2026 14:44:20 +0200 Subject: [PATCH] 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. --- apps/shared/wallet/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/shared/wallet/CMakeLists.txt b/apps/shared/wallet/CMakeLists.txt index 37f1663..896716b 100644 --- a/apps/shared/wallet/CMakeLists.txt +++ b/apps/shared/wallet/CMakeLists.txt @@ -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")