diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-12 12:51:53 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-12 21:13:56 +0100 |
commit | c2d188f225a96ccf409f4dbebd19f6e59caf7da6 (patch) | |
tree | 35d0320171ad60a4e25c41f0718d02016dfd4242 /coin/provisioning/common/windows/03-conan.ps1 | |
parent | ab25cb7af6602a558c84e3d30e8ce1c6e7ca6e73 (diff) | |
parent | 19872ea84352182ee974ff84d2e3872a21427117 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
coin/platform_configs/default.txt
coin/platform_configs/qt5.txt
Task-number: QTBUG-65688
Change-Id: I17a303731dab4b967c9ef8a852ee0c1097b88f10
Diffstat (limited to 'coin/provisioning/common/windows/03-conan.ps1')
-rw-r--r-- | coin/provisioning/common/windows/03-conan.ps1 | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/coin/provisioning/common/windows/03-conan.ps1 b/coin/provisioning/common/windows/03-conan.ps1 new file mode 100644 index 00000000..2c9d9f8d --- /dev/null +++ b/coin/provisioning/common/windows/03-conan.ps1 @@ -0,0 +1,62 @@ +. "$PSScriptRoot\helpers.ps1" + +$scriptsPath = "C:\Python27\Scripts" + +& "$scriptsPath\pip.exe" install --upgrade conan==0.24.0 + +# Use Qt Project repository by default +& "$scriptsPath\conan.exe" remote add qtproject https://api.bintray.com/conan/qtproject/conan --insert + +[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)" + } + + $manifestsDir = "$PSScriptRoot\conan_manifests" + + Get-ChildItem -Path "$ConanfilesDir\*.txt" | + ForEach-Object { + $conanfile = $_.FullName + $outpwd = "C:\Utils\conanbuildinfos\$($BuildinfoDir)\$($_.BaseName)" + 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" + } +} |