From 89aa6e780a28b2c6dc9f57d14afd2c49b743f472 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 10 Jul 2019 10:21:42 +0200 Subject: Fix determination of host_arch test binary The host architecture detection binary's file extension is determined by the host platform, not the target platform. Respect the host variable that's set in configure.json. This amends commit d9fb502. Change-Id: I134cd7cf12d6a6fe458ac5e37c48dd311d6c4418 Reviewed-by: Simon Hausmann --- configure.pri | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/configure.pri b/configure.pri index da5d22382d..e9fd055854 100644 --- a/configure.pri +++ b/configure.pri @@ -266,17 +266,30 @@ defineTest(qtConfTest_architecture) { !qtConfTest_compile($${1}): \ error("Could not determine $$eval($${1}.label). See config.log for details.") + host = $$eval($${1}.host) + isEmpty(host): host = false + file_prefix = + ext = + $$host { + equals(QMAKE_HOST.os, Windows): \ + ext = .exe + } else { + win32 { + ext = .exe + } else:android { + file_prefix = lib + ext = .so + } else:wasm { + ext = .wasm + } + } + test = $$eval($${1}.test) output = $$eval($${1}.output) test_out_dir = $$OUT_PWD/$$basename(QMAKE_CONFIG_TESTS_DIR)/$$test - unix:exists($$test_out_dir/$$output): \ - content = $$cat($$test_out_dir/$$output, blob) - else: win32:exists($$test_out_dir/$${output}.exe): \ - content = $$cat($$test_out_dir/$${output}.exe, blob) - else: android:exists($$test_out_dir/lib$${output}.so): \ - content = $$cat($$test_out_dir/lib$${output}.so, blob) - else: wasm:exists($$test_out_dir/$${output}.wasm): \ - content = $$cat($$test_out_dir/$${output}.wasm, blob) + test_out_file = $$test_out_dir/$$file_prefix$$output$$ext + exists($$test_out_file): \ + content = $$cat($$test_out_file, blob) else: \ error("$$eval($${1}.label) detection binary not found.") -- cgit v1.2.3