Introduce UseToolchainFromTargetDir feature for tests that are built at test stage

The feature allows controlling which toolchain should be used when
building tests. Since WoA supposed to build tests using the
crosscompiled Qt in native host environment, this option allows
preparing the correct build environment and use the crosscompiled
'target' Qt.

Drive-by change the way prefix.bat is called for native WoA configuration.

Pick-to: 6.10
Change-Id: Ifec7593b4216ee2e2ffe185ae0dc0559d501762b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2025-08-07 17:25:22 +02:00
parent 26e0396381
commit 238400b22f
2 changed files with 21 additions and 11 deletions

View File

@ -8,16 +8,26 @@ instructions:
instructions: instructions:
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_host.yaml" - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_host.yaml"
disable_if: disable_if:
condition: property condition: or
property: target.osVersion conditions:
in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks] - condition: property
property: target.osVersion
in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks]
- condition: property
property: features
contains_value: UseToolchainFromTargetDir
- type: Group - type: Group
instructions: instructions:
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml" - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml"
enable_if: enable_if:
condition: property condition: or
property: target.osVersion conditions:
in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks] - condition: property
property: target.osVersion
in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks]
- condition: property
property: features
contains_value: UseToolchainFromTargetDir
enable_if: enable_if:
condition: property condition: property
property: features property: features

View File

@ -202,8 +202,8 @@ instructions:
property: target.arch property: target.arch
in_values: ["AARCH64", "ARM64"] in_values: ["AARCH64", "ARM64"]
- condition: property - condition: property
property: host property: host.arch
equals_property: target in_values: ["AARCH64", "ARM64"]
- type: EnvironmentVariable - type: EnvironmentVariable
# HACK. Overwrite TARGET_ARCHITECTURE as we do not use standard MSVC cross # HACK. Overwrite TARGET_ARCHITECTURE as we do not use standard MSVC cross
# compilation targets here. The target architecture will be detected by Qt. # compilation targets here. The target architecture will be detected by Qt.
@ -398,11 +398,11 @@ instructions:
condition: and condition: and
conditions: conditions:
- condition: property - condition: property
property: target.os property: host.os
equals_value: Windows equals_value: Windows
- condition: property - condition: property
property: target.arch property: host.compiler
not_equals_property: host.arch contains_value: MSVC
instructions: instructions:
- type: EnvironmentVariable - type: EnvironmentVariable
variableName: TARGET_ENV_PREFIX variableName: TARGET_ENV_PREFIX