From 486a89f7bb7007bf045195193999070c54e3dc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Wed, 10 May 2023 11:08:48 +0200 Subject: [PATCH] wasm: add INSTALL_LIBDIR as library search path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes error where Emscripten fails to find Qt library dependencies at application link time. Change-Id: I03b154f60ab5dc3a4c8d0d21d47551c9584029a2 Reviewed-by: Piotr Wierciński Reviewed-by: Mikołaj Boc --- cmake/QtWasmHelpers.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtWasmHelpers.cmake b/cmake/QtWasmHelpers.cmake index 29478b33a4..3eb97fa3cb 100644 --- a/cmake/QtWasmHelpers.cmake +++ b/cmake/QtWasmHelpers.cmake @@ -105,6 +105,12 @@ function (qt_internal_setup_wasm_target_properties wasmTarget) "${enable_main_module_if_needed}" ) + # Add Qt libdir to linker library paths + set(qt_lib_location + "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_LIBDIR}") + target_link_options("${wasmTarget}" INTERFACE + "$<$,EXECUTABLE>:SHELL:" -L${qt_lib_location}/>) + target_compile_options("${wasmTarget}" INTERFACE "${set_shared_module_type_if_needed}") target_link_options("${wasmTarget}" INTERFACE "${set_shared_module_type_if_needed}")