summaryrefslogtreecommitdiffstats
path: root/cmake/QtBaseConfigureTests.cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-08-28 15:01:23 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-08-28 13:23:50 +0000
commit4e5fc66c04bddfc8a62e978716b0b57e9e468aaf (patch)
tree32c029c6c813b0debb34fac70e64a6cb1db14de3 /cmake/QtBaseConfigureTests.cmake
parentadd4c4816c3979c9830af95348c2d5fe51f5125c (diff)
Fix architecture detection with WASM builds
This is a simple mis-understanding between try_compile assuming interest in the launching part of the thing we try to compile and our architecture test being interested in the binary. Change-Id: Ie972b662b6f34699f566649bb2c1e29da35b58c3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBaseConfigureTests.cmake')
-rw-r--r--cmake/QtBaseConfigureTests.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake
index ffa5019ca0..34e4e6e6f1 100644
--- a/cmake/QtBaseConfigureTests.cmake
+++ b/cmake/QtBaseConfigureTests.cmake
@@ -3,9 +3,20 @@ function(run_config_test_architecture)
set(qt_base_configure_tests_vars_to_export)
# Test architecture
set(_arch_file "${CMAKE_CURRENT_BINARY_DIR}/architecture_test")
+ set(saved_executable_suffix "${CMAKE_EXECUTABLE_SUFFIX}")
+
+ # With emscripten the application entry point is a .js file (to be run with node for example), but the
+ # real "data" is in the .wasm file, so that's where we need to look for the ABI, etc. information.
+ if (EMSCRIPTEN)
+ set(CMAKE_EXECUTABLE_SUFFIX ".wasm")
+ endif()
+
try_compile(_arch_result "${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/config.tests/arch/arch.cpp"
COPY_FILE "${_arch_file}")
+
+ set(CMAKE_EXECUTABLE_SUFFIX "${saved_executable_suffix}")
+
if (NOT _arch_result)
message(FATAL_ERROR "Failed to compile architecture detection file.")
endif()