diff options
-rw-r--r-- | cmake/QtPublicTestHelpers.cmake | 4 | ||||
-rw-r--r-- | cmake/QtTestHelpers.cmake | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cmake/QtPublicTestHelpers.cmake b/cmake/QtPublicTestHelpers.cmake index 0cfbfab404..771911c5d5 100644 --- a/cmake/QtPublicTestHelpers.cmake +++ b/cmake/QtPublicTestHelpers.cmake @@ -64,7 +64,7 @@ is not specified") #Escaping environment variables before expand them by file GENERATE string(REPLACE "\\" "\\\\" environment_extras "${environment_extras}") - if(WIN32) + if(CMAKE_HOST_WIN32) # It's necessary to call actual test inside 'cmd.exe', because 'execute_process' uses # SW_HIDE to avoid showing a console window, it affects other GUI as well. # See https://gitlab.kitware.com/cmake/cmake/-/issues/17690 for details. @@ -97,7 +97,7 @@ execute_process(COMMAND ${extra_runner} ${arg_COMMAND} ) ${post_run} if(NOT result EQUAL 0) - string(JOIN \" \" full_command ${arg_COMMAND}) + string(JOIN \" \" full_command ${extra_runner} ${arg_COMMAND}) message(FATAL_ERROR \"\${full_command} execution failed with exit code \${result}.\") endif()" ) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 934ac0ec9f..d54da875cd 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -676,7 +676,11 @@ function(qt_internal_add_test name) # This tells cmake to run the tests with this script, since wasm files can't be # executed directly - set_property(TARGET "${name}" PROPERTY CROSSCOMPILING_EMULATOR "emrun") + if (CMAKE_HOST_WIN32) + set_property(TARGET "${name}" PROPERTY CROSSCOMPILING_EMULATOR "emrun.bat") + else() + set_property(TARGET "${name}" PROPERTY CROSSCOMPILING_EMULATOR "emrun") + endif() else() if(arg_QMLTEST AND NOT arg_SOURCES) set(test_working_dir "${CMAKE_CURRENT_SOURCE_DIR}") |