Skip to content

Commit

Permalink
wasm: add INSTALL_LIBDIR as library search path
Browse files Browse the repository at this point in the history
Fixes error where Emscripten fails to find Qt library
dependencies at application link time.

Change-Id: I03b154f60ab5dc3a4c8d0d21d47551c9584029a2
Reviewed-by: Piotr Wierciński <[email protected]>
Reviewed-by: Mikołaj Boc <[email protected]>
  • Loading branch information
Morten Sørvig committed May 22, 2023
1 parent 8d13a9e commit 486a89f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/QtWasmHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down

0 comments on commit 486a89f

Please sign in to comment.