summaryrefslogtreecommitdiffstats
path: root/cmake/QtToolchainHelpers.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/QtToolchainHelpers.cmake')
-rw-r--r--cmake/QtToolchainHelpers.cmake15
1 files changed, 14 insertions, 1 deletions
diff --git a/cmake/QtToolchainHelpers.cmake b/cmake/QtToolchainHelpers.cmake
index 5ab1236b8f..863a3af8c3 100644
--- a/cmake/QtToolchainHelpers.cmake
+++ b/cmake/QtToolchainHelpers.cmake
@@ -33,7 +33,10 @@ function(qt_internal_create_toolchain_file)
if(CMAKE_TOOLCHAIN_FILE)
file(TO_CMAKE_PATH "${CMAKE_TOOLCHAIN_FILE}" __qt_chainload_toolchain_file)
set(init_original_toolchain_file
- "set(__qt_chainload_toolchain_file \"${__qt_chainload_toolchain_file}\")")
+ "
+set(__qt_initially_configured_toolchain_file \"${__qt_chainload_toolchain_file}\")
+set(__qt_chainload_toolchain_file \"\${__qt_initially_configured_toolchain_file}\")
+")
endif()
if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
@@ -223,6 +226,16 @@ function(qt_internal_create_toolchain_file)
" \"Please specify the toolchain file with -DQT_CHAINLOAD_TOOLCHAIN_FILE=<file>.\")")
list(APPEND init_platform " endif()")
list(APPEND init_platform "endif()")
+ elseif(EMSCRIPTEN)
+ list(APPEND init_platform
+"include(\${CMAKE_CURRENT_LIST_DIR}/QtPublicWasmToolchainHelpers.cmake)
+if(DEFINED ENV{EMSDK} AND NOT \"\$ENV{EMSDK}\" STREQUAL \"\")
+ __qt_internal_get_emroot_path_suffix_from_emsdk_env(__qt_toolchain_emroot_path)
+ __qt_internal_get_emscripten_cmake_toolchain_file_path_from_emsdk_env(
+ \"\${__qt_toolchain_emroot_path}\" _qt_candidate_emscripten_toolchain_path)
+ set(__qt_chainload_toolchain_file \"\${_qt_candidate_emscripten_toolchain_path}\")
+endif()
+")
endif()
string(REPLACE ";" "\n" init_additional_used_variables