From f2ae9b3baa41adb8f0f92e801e06f45a09a871a5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 28 Apr 2020 13:52:35 +0200 Subject: CMake: Adjust instructions for MinGW builds Don't do any of the MSVC-related instructions when targeting MinGW. Make sure to pass gcc and g++ as compilers when targeting MinGW. Don't use any ENV_PREFIX that sets up the MSVC environment. Task-number: QTBUG-75578 Change-Id: Icf5c39b58391d473d914fe8dc17d062812b07df1 Reviewed-by: Simon Hausmann --- coin/instructions/prepare_building_env.yaml | 66 +++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/coin/instructions/prepare_building_env.yaml b/coin/instructions/prepare_building_env.yaml index e03179a0e8..5e781bdff4 100644 --- a/coin/instructions/prepare_building_env.yaml +++ b/coin/instructions/prepare_building_env.yaml @@ -38,9 +38,14 @@ instructions: variableName: CONFIGURE_ARGS variableValue: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ " enable_if: - condition: property - property: host.compiler - contains_value: GCC + condition: or + conditions: + - condition: property + property: host.compiler + contains_value: GCC + - condition: property + property: host.compiler + contains_value: Mingw - type: PrependToEnvironmentVariable variableName: CONFIGURE_ARGS variableValue: "-DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe " @@ -60,9 +65,14 @@ instructions: # Export TARGET_ARCHITECTURE and WINDOWS_SDK_VERSION for MSVC cross compilation - type: Group enable_if: - condition: property - property: host.os - equals_value: Windows + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: host.compiler + not_contains_value: Mingw instructions: - type: EnvironmentVariable variableName: TARGET_ARCHITECTURE @@ -114,9 +124,14 @@ instructions: # or we use compiler specific generator (probably superior solution as it allows to get rid of ENV_PREFIX). - type: Group enable_if: - condition: property - property: host.os - equals_value: Windows + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: host.compiler + not_contains_value: Mingw instructions: # Try to pick one of many coexistent MSVC installation to use # TODO cleanup, that could be much simpler if all tools are installed to similar paths, so it would @@ -183,23 +198,38 @@ instructions: maxTimeInSeconds: 20 maxTimeBetweenOutput: 20 enable_if: - condition: property - property: host.os - equals_value: Windows + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: host.compiler + not_contains_value: Mingw - type: EnvironmentVariable variableName: ENV_PREFIX variableValue: "c:\\users\\qt\\prefix.bat" enable_if: - condition: property - property: host.os - equals_value: Windows + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: host.compiler + not_contains_value: Mingw - type: EnvironmentVariable variableName: ENV_PREFIX variableValue: "" disable_if: - condition: property - property: host.os - equals_value: Windows + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: host.compiler + not_contains_value: Mingw - type: Group instructions: -- cgit v1.2.3