diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-27 12:27:23 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-27 18:29:44 +0200 |
commit | 2ed267c82015f5eab7fe65aad6553eb0d6bb338d (patch) | |
tree | 8ee77579e5865282657cd171c8f188f3d2241331 /cmake/QtPublicWasmToolchainHelpers.cmake | |
parent | 5d840f0f7a575a5163800519d7ef7d4ba228135a (diff) |
CMake: Show error in user projects if wasm toolchain file not found
Rather than fail with obscure can't find Qt packages errors when the
Webassembly CMake toolchain file can not be found, error out with a
clear error on how to ensure it is found.
Pick-to: 6.2
Task-number: QTBUG-96843
Change-Id: I0f34cdcde05efb25c93017f3fd365186335ed52c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtPublicWasmToolchainHelpers.cmake')
-rw-r--r-- | cmake/QtPublicWasmToolchainHelpers.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/QtPublicWasmToolchainHelpers.cmake b/cmake/QtPublicWasmToolchainHelpers.cmake index 53d74e0234..8d0d9efdc9 100644 --- a/cmake/QtPublicWasmToolchainHelpers.cmake +++ b/cmake/QtPublicWasmToolchainHelpers.cmake @@ -53,3 +53,19 @@ function(__qt_internal_get_emcc_recommended_version out_var) set(QT_EMCC_RECOMMENDED_VERSION "2.0.14") set(${out_var} "${QT_EMCC_RECOMMENDED_VERSION}" PARENT_SCOPE) endfunction() + +function(__qt_internal_show_error_no_emscripten_toolchain_file_found_when_building_qt) + message(FATAL_ERROR + "Cannot find the toolchain file Emscripten.cmake. " + "Please specify the toolchain file with -DCMAKE_TOOLCHAIN_FILE=<file> " + "or provide a path to a valid emscripten installation via the EMSDK " + "environment variable.") +endfunction() + +function(__qt_internal_show_error_no_emscripten_toolchain_file_found_when_using_qt) + message(FATAL_ERROR + "Cannot find the toolchain file Emscripten.cmake. " + "Please specify the toolchain file with -DQT_CHAINLOAD_TOOLCHAIN_FILE=<file> " + "or provide a path to a valid emscripten installation via the EMSDK " + "environment variable.") +endfunction() |