wasm: add INSTALL_LIBDIR as library search path

Fixes error where Emscripten fails to find Qt library
dependencies at application link time.

Change-Id: I03b154f60ab5dc3a4c8d0d21d47551c9584029a2
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
This commit is contained in:
Morten Sørvig 2023-05-10 11:08:48 +02:00
parent 8d13a9e387
commit 486a89f7bb

View File

@ -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
"$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,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}")