qt5base-lts/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml
Alexandru Croitor b3e01d608e CMake: Use custom install script to support Ninja Multi-Config builds
Calling cmake --install . only installs a single configuration.

To install both debug and release artifacts, the install
invocation needs to be done for each configuration.

To keep the Coin instruction code simpler, delegate the looping
over configurations to a custom CMake script, and use it in the
Coin instructions.

Replace all cmake --install calls in the instructions with calls
to either call_host_install.yaml or call_target_install.yaml.

The path to the script depends on whether we are building
qtbase or another module. In the former case the script should
be called from the build dir, otherwise from the install dir.

The other distinction is whether the host or target env prefix
needs to be added.

Task-number: QTBUG-80900
Change-Id: Ied4bf739e2b1a2307f22fc79c1cfad746c8cbc44
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-19 10:16:11 +02:00

74 lines
2.7 KiB
YAML

type: Group
instructions:
- type: MakeDirectory
directory: .git
- type: MakeDirectory
directory: build
- type: ChangeDirectory
directory: "{{.BuildDir}}/build"
- type: MakeDirectory
directory: host
- type: MakeDirectory
directory: target
- type: SetBuildDirectory
directory: "{{.SourceDir}}/build/host"
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/host -DBUILD_TESTING=OFF {{.SourceDir}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to call cmake.
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel -v"
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to build sources. In the current state bug can be everywhere.
- type: EnvironmentVariable
variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH
variableValue: "{{.BuildDir}}"
- !include "{{qt/qtbase}}/call_host_install.yaml"
- type: EnvironmentVariable
variableName: DESTDIR
variableValue: "{{.InstallRoot}}"
- !include "{{qt/qtbase}}/call_host_install.yaml"
- type: EnvironmentVariable
variableName: DESTDIR
variableValue: ""
- type: SetBuildDirectory
directory: "{{.SourceDir}}/build/target"
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: ExecuteCommand
command: "{{.Env.TARGET_ENV_PREFIX}} cmake {{.Env.TARGET_CONFIGURE_ARGS}} -DQT_HOST_PATH={{.InstallDir}}/host -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/target -DBUILD_TESTING=OFF {{.SourceDir}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to call cmake.
- type: ExecuteCommand
command: "{{.Env.TARGET_ENV_PREFIX}} cmake --build . --parallel -v"
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to build sources. In the current state bug can be everywhere.
- type: EnvironmentVariable
variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH
variableValue: "{{.BuildDir}}"
- !include "{{qt/qtbase}}/call_target_install.yaml"
- type: EnvironmentVariable
variableName: DESTDIR
variableValue: "{{.InstallRoot}}"
- !include "{{qt/qtbase}}/call_target_install.yaml"
- type: EnvironmentVariable
variableName: DESTDIR
variableValue: ""
- type: UploadArtifact
archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
transferType: UploadModuleBuildArtifact
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200