build: make clang using gcc toolchain on Linux
also fix Mac build failure related to 'ar'
This commit is contained in:
committed by
SvyatoslavScherbina
parent
bee2a76008
commit
66bd698270
+14
-1
@@ -13,8 +13,21 @@ allprojects {
|
|||||||
evaluationDependsOn(":dependencies")
|
evaluationDependsOn(":dependencies")
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.clangArgs = ["--sysroot=$sysrootDir", "-B$sysrootDir/usr/bin"]
|
|
||||||
ext.clangPath = ["$llvmDir/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)
|
convention.plugins.execClang = new org.jetbrains.kotlin.ExecClang(project)
|
||||||
|
|
||||||
|
|||||||
Vendored
+8
-3
@@ -78,9 +78,14 @@ task llvm(type: TgzNativeDep) {
|
|||||||
baseName = "clang+llvm-3.8.0-$target"
|
baseName = "clang+llvm-3.8.0-$target"
|
||||||
}
|
}
|
||||||
|
|
||||||
task sysroot(type: TgzNativeDep) {
|
if (isLinux()) {
|
||||||
String version = (target == 'linux-x86-64') ? '2' : '1'
|
task gccToolchain(type: TgzNativeDep) {
|
||||||
baseName = "target-sysroot-$version-$target"
|
baseName = "target-gcc-toolchain-3-$target"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
task sysroot(type: TgzNativeDep) {
|
||||||
|
baseName = "target-sysroot-1-$target"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user