diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2019-07-10 10:21:42 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2019-07-10 10:53:04 +0200 |
commit | 89aa6e780a28b2c6dc9f57d14afd2c49b743f472 (patch) | |
tree | b9418a848a47fa8bcfed35784f09e0acb6fbd314 | |
parent | b426cff1e0363b350f98bc64691b9b279bc6c757 (diff) |
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 <simon.hausmann@qt.io>
-rw-r--r-- | configure.pri | 29 |
1 files 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.") |