Install the MinGW build of libclang

This restores the MinGW installation of libclang on Windows 7 and
installs the MSVC and MinGW builds in parallel on Windows 10. For
compatibility reasons the MSVC installation is done last, to ensure that
the older LLVM_INSTALL_DIR variable points to the MSVC installation. In
addition though we now get LLVM_INSTALL_DIR_MINGW and
LLVM_INSTALL_DIR_MSVC, which qt_find_clang.prf in qttools can use in the
future.

Task-number: QTBUG-66015
Change-Id: I8b53b85d0cde597c88a089f2a05f03947828d9bd
Reviewed-by: Simo Fält <simo.falt@qt.io>
This commit is contained in:
Simon Hausmann
2018-04-30 09:36:26 +02:00
committed by Jani Heikkinen
parent d14d8f0cac
commit 41369b6282
4 changed files with 17 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
param(
[Int32]$archVer=32,
[string]$toolchain="vs2015"
[string]$toolchain="vs2015",
[bool]$setDefault=$true
)
. "$PSScriptRoot\helpers.ps1"
@@ -11,17 +12,19 @@ param(
Get-Content "$PSScriptRoot\..\shared\sw_versions.txt" | Foreach-Object {
$var = $_.Split('=')
New-Variable -Name $var[0] -Value $var[1]
New-Variable -Name $var[0] -Value $var[1] -Force
$libclang_version = $libclang_version -replace '["."]'
}
$zip = "c:\users\qt\downloads\libclang.7z"
$baseDestination = "C:\Utils\libclang-" + $libclang_version
$baseDestination = "C:\Utils\libclang-" + $libclang_version + "-" + $toolchain
function setURL() {
$script:url = "https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_$libclang_version-windows-$toolchain`_$archVer.7z"
}
$toolchainSuffix = ""
if ( $toolchain -eq "vs2015" ) {
if ( $archVer -eq 64 ) {
$sha1 = "37afa18d243a50c05bee5c6e16b409ed526ec17a"
@@ -47,6 +50,7 @@ if ( $toolchain -eq "vs2015" ) {
Extract-7Zip $zip C:\Utils\
Rename-Item C:\Utils\libclang $destination
Remove-Item -Force -Path $zip
$toolchainSuffix = "msvc"
}
if ( $toolchain -eq "mingw" ) {
@@ -74,7 +78,11 @@ if ( $toolchain -eq "mingw" ) {
Extract-7Zip $zip C:\Utils\
Rename-Item C:\Utils\libclang $destination
Remove-Item -Force -Path $zip
$toolchainSuffix = "mingw"
}
Set-EnvironmentVariable "LLVM_INSTALL_DIR" ($baseDestination + "-_ARCH_")
if ( $setDefault ) {
Set-EnvironmentVariable "LLVM_INSTALL_DIR" ($baseDestination + "-_ARCH_")
}
Set-EnvironmentVariable ("LLVM_INSTALL_DIR_" + $toolchainSuffix) ($baseDestination + "-_ARCH_")
Write-Output "libClang = $libclang_version" >> ~/versions.txt

View File

@@ -1 +1,3 @@
# Do not set the default LLVM_INSTALL_DIR for mingw, leave it with msvc for compat
. "$PSScriptRoot\..\common\windows\libclang.ps1" 32 mingw $False
. "$PSScriptRoot\..\common\windows\libclang.ps1" 32 vs2015

View File

@@ -1 +1,3 @@
# Do not set the default LLVM_INSTALL_DIR for mingw, leave it with msvc for compat
. "$PSScriptRoot\..\common\windows\libclang.ps1" 64 mingw $False
. "$PSScriptRoot\..\common\windows\libclang.ps1" 64 vs2015

View File

@@ -0,0 +1 @@
. "$PSScriptRoot\..\common\windows\libclang.ps1" 32 mingw