mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-02 03:36:54 +08:00
Conanfile is required for running "conan imports" as a part of "make install" procedure, however its original location is unknown to build system of module. Conanfile is copied with its conventional name "conanfile.txt" to avoid tying module build system to more qt5.git layout peculiarities. In future we may want to have several conanfiles in one provisioning dir, like qtwebkit-mingw.txt and qtwebkit-msvc.txt. Also simplified syntax of PowerShell variables interpolation, $() is needed only for interpolating expressions. Task-number: QTQAINFRA-998 Change-Id: I6904e80f4f85bb5269b0830272c6eaa2c8100789 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
59 lines
1.7 KiB
PowerShell
59 lines
1.7 KiB
PowerShell
. "$PSScriptRoot\helpers.ps1"
|
|
|
|
$scriptsPath = "C:\Python27\Scripts"
|
|
|
|
& "$scriptsPath\pip.exe" install --upgrade conan==0.16.0
|
|
|
|
[Environment]::SetEnvironmentVariable("CI_CONAN_BUILDINFO_DIR", "C:\Utils\conanbuildinfos", "Machine")
|
|
|
|
function Start-Process-Logged
|
|
{
|
|
Write-Host "Start-Process", $args
|
|
Start-Process @args
|
|
}
|
|
|
|
function Run-Conan-Install
|
|
{
|
|
Param (
|
|
[string]$ConanfilesDir,
|
|
[string]$BuildinfoDir,
|
|
[string]$Arch,
|
|
[string]$Compiler,
|
|
[string]$CompilerVersion,
|
|
[string]$CompilerRuntime,
|
|
[string]$CompilerLibcxx
|
|
)
|
|
|
|
if ($CompilerRuntime) {
|
|
$extraArgs = "-s compiler.runtime=$($CompilerRuntime)"
|
|
}
|
|
|
|
if ($CompilerLibcxx) {
|
|
$extraArgs = "-s compiler.libcxx=$($CompilerLibcxx)"
|
|
}
|
|
|
|
Get-ChildItem -Path "$ConanfilesDir\*.txt" |
|
|
ForEach-Object {
|
|
$conanfile = $_.FullName
|
|
$outpwd = "C:\Utils\conanbuildinfos\$($BuildinfoDir)\$($_.BaseName)"
|
|
$manifestsDir = "$($_.DirectoryName)\$($_.BaseName).manifests"
|
|
New-Item $outpwd -Type directory -Force
|
|
|
|
$process = Start-Process-Logged `
|
|
"$scriptsPath\conan.exe" `
|
|
-WorkingDirectory $outpwd `
|
|
-ArgumentList "install -f $conanfile --no-imports --verify $manifestsDir", `
|
|
'-s', ('compiler="' + $Compiler + '"'), `
|
|
"-s os=Windows -s arch=$Arch -s compiler.version=$CompilerVersion $extraArgs" `
|
|
-NoNewWindow -Wait -Verbose `
|
|
-PassThru # Return process object
|
|
|
|
if ($process.ExitCode -ne 0) {
|
|
Write-Host "conan exited with code $($process.ExitCode)"
|
|
Exit(1)
|
|
}
|
|
|
|
Copy-Item -Path $conanfile -Destination "$outpwd\conanfile.txt"
|
|
}
|
|
}
|