wasm: do not set autodetect wasm true until we actually detect

Change-Id: Ib6bdd3d5ed7dab108b636284ee564d14dbc2d5c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Lorn Potter 2021-04-27 06:36:05 +10:00
parent e439fab4be
commit cdad78a4a4

View File

@ -9,7 +9,6 @@
function(qt_auto_detect_wasm)
if("${QT_QMAKE_TARGET_MKSPEC}" STREQUAL "wasm-emscripten" AND DEFINED ENV{EMSDK})
if(NOT DEFINED QT_AUTODETECT_WASM)
set(QT_AUTODETECT_WASM TRUE CACHE BOOL "")
# detect EMSCRIPTEN_ROOT path
file(READ "$ENV{EMSDK}/.emscripten" ver)
string(REGEX MATCH "EMSCRIPTEN_ROOT.*$" EMROOT "${ver}")
@ -48,6 +47,7 @@ function(qt_auto_detect_wasm)
message(FATAL_ERROR "Cannot find the toolchain file Emscripten.cmake. "
"Please specify the toolchain file with -DCMAKE_TOOLCHAIN_FILE=<file>.")
endif()
set(QT_AUTODETECT_WASM TRUE CACHE BOOL "")
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Qt statically or dynamically" FORCE)