build: make clang using gcc toolchain on Linux

also fix Mac build failure related to 'ar'
This commit is contained in:
Svyatoslav Scherbina
2016-11-11 16:39:38 +07:00
committed by SvyatoslavScherbina
parent bee2a76008
commit 66bd698270
2 changed files with 22 additions and 4 deletions
+14 -1
View File
@@ -13,8 +13,21 @@ allprojects {
evaluationDependsOn(":dependencies")
}
ext.clangArgs = ["--sysroot=$sysrootDir", "-B$sysrootDir/usr/bin"]
ext.clangPath = ["$llvmDir/bin"]
ext.clangArgs = []
final String binDir
if (isLinux()) {
binDir = "$gccToolchainDir/$gnuTriplet/bin"
ext.clangArgs.addAll([
"--sysroot=$gccToolchainDir/$gnuTriplet/sysroot",
"--gcc-toolchain=$gccToolchainDir"
])
} else {
binDir = "$sysrootDir/usr/bin"
ext.clangArgs << "--sysroot=$sysrootDir"
}
ext.clangArgs << "-B$binDir"
ext.clangPath << binDir
convention.plugins.execClang = new org.jetbrains.kotlin.ExecClang(project)
+8 -3
View File
@@ -78,9 +78,14 @@ task llvm(type: TgzNativeDep) {
baseName = "clang+llvm-3.8.0-$target"
}
task sysroot(type: TgzNativeDep) {
String version = (target == 'linux-x86-64') ? '2' : '1'
baseName = "target-sysroot-$version-$target"
if (isLinux()) {
task gccToolchain(type: TgzNativeDep) {
baseName = "target-gcc-toolchain-3-$target"
}
} else {
task sysroot(type: TgzNativeDep) {
baseName = "target-sysroot-1-$target"
}
}