build: download llvm and libffi from the JFrog repo
This commit is contained in:
@@ -24,11 +24,11 @@ model {
|
||||
|
||||
binaries.all {
|
||||
cCompiler.args compilerArgsForJniIncludes
|
||||
cCompiler.args "-I$llvmInstallPath/include"
|
||||
cCompiler.args "-I$llvmDir/include"
|
||||
}
|
||||
|
||||
binaries.withType(SharedLibraryBinarySpec) {
|
||||
linker.args "-L$llvmInstallPath/lib", "-lclang"
|
||||
linker.args "-L$llvmDir/lib", "-lclang"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,9 @@ model {
|
||||
}
|
||||
binaries.all {
|
||||
cCompiler.args compilerArgsForJniIncludes
|
||||
cCompiler.args "-I$ffiIncludePath"
|
||||
cCompiler.args "-I$libffiDir/include"
|
||||
|
||||
String libffiPicPath = "$ffiLibPath/libffi_pic.a"
|
||||
linker.args file(libffiPicPath).exists() ? libffiPicPath : "$ffiLibPath/libffi.a"
|
||||
linker.args "$libffiDir/lib/libffi.a"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ repositories {
|
||||
kotlinNativeInterop {
|
||||
llvm {
|
||||
defFile '../backend.native/llvm.def'
|
||||
compilerOpts "-I$llvmInstallPath/include"
|
||||
linkerOpts "-L$llvmInstallPath/lib"
|
||||
compilerOpts "-I$llvmDir/include"
|
||||
linkerOpts "-L$llvmDir/lib"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ sourceSets {
|
||||
kotlinNativeInterop {
|
||||
llvm {
|
||||
defFile 'llvm.def'
|
||||
compilerOpts "-I$llvmInstallPath/include"
|
||||
linkerOpts "-L$llvmInstallPath/lib"
|
||||
compilerOpts "-I$llvmDir/include"
|
||||
linkerOpts "-L$llvmDir/lib"
|
||||
}
|
||||
|
||||
hash { // TODO: copy-pasted from ':common:compileHash'
|
||||
|
||||
@@ -70,7 +70,7 @@ class CompileCppToBitcode extends DefaultTask {
|
||||
|
||||
project.exec {
|
||||
workingDir objDir
|
||||
executable "$project.llvmInstallPath/bin/clang++"
|
||||
executable "$project.llvmDir/bin/clang++"
|
||||
args '-std=c++11'
|
||||
|
||||
args compilerArgs
|
||||
@@ -82,7 +82,7 @@ class CompileCppToBitcode extends DefaultTask {
|
||||
}
|
||||
|
||||
project.exec {
|
||||
executable "$project.llvmInstallPath/bin/llvm-link"
|
||||
executable "$project.llvmDir/bin/llvm-link"
|
||||
args project.fileTree(objDir).include('**/*.bc')
|
||||
|
||||
args linkerArgs
|
||||
|
||||
@@ -141,10 +141,10 @@ class NamedNativeInteropConfig extends AbstractFileCollection implements Named {
|
||||
new File(project.findProject(":Interop:Indexer").buildDir, "nativelibs"),
|
||||
new File(project.findProject(":Interop:Runtime").buildDir, "nativelibs")
|
||||
).asPath
|
||||
systemProperties "llvmInstallPath" : project.llvmInstallPath
|
||||
systemProperties "llvmInstallPath" : project.llvmDir
|
||||
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
|
||||
environment "DYLD_LIBRARY_PATH": "${project.llvmInstallPath}/lib"
|
||||
environment "LD_LIBRARY_PATH": "${project.llvmInstallPath}/lib"
|
||||
environment "DYLD_LIBRARY_PATH": "${project.llvmDir}/lib"
|
||||
environment "LD_LIBRARY_PATH": "${project.llvmDir}/lib"
|
||||
|
||||
outputs.dir generatedSrcDir
|
||||
outputs.dir nativeLibsDir
|
||||
|
||||
Vendored
+9
@@ -75,6 +75,15 @@ class TgzNativeDep extends NativeDep {
|
||||
}
|
||||
|
||||
|
||||
task libffi(type: TgzNativeDep) {
|
||||
baseName = "libffi-3.2.1-${target}"
|
||||
}
|
||||
|
||||
task llvm(type: TgzNativeDep) {
|
||||
baseName = "clang+llvm-3.8.0-${target}"
|
||||
}
|
||||
|
||||
|
||||
task update {
|
||||
dependsOn tasks.withType(NativeDep)
|
||||
}
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
kotlin_version=1.0.4
|
||||
llvmInstallPath=/opt/local/libexec/llvm-3.8
|
||||
ffiIncludePath=/opt/local/lib/libffi-3.2.1/include
|
||||
ffiLibPath=/opt/local/lib
|
||||
|
||||
@@ -17,15 +17,15 @@ task test {
|
||||
|
||||
doLast {
|
||||
exec {
|
||||
commandLine "$llvmInstallPath/bin/clang", 'src/test/c/main.c', '-c', '-emit-llvm', '-o', "$buildDir/main.bc"
|
||||
}
|
||||
commandLine "$llvmDir/bin/clang", 'src/test/c/main.c', '-c', '-emit-llvm', '-o', "$buildDir/main.bc"
|
||||
}
|
||||
exec {
|
||||
commandLine "$llvmInstallPath/bin/clang++", build.outFile, "$buildDir/main.bc", '-o', "$buildDir/main"
|
||||
}
|
||||
exec {
|
||||
workingDir buildDir
|
||||
commandLine './main'
|
||||
}
|
||||
commandLine "$llvmDir/bin/clang++", build.outFile, "$buildDir/main.bc", '-o', "$buildDir/main"
|
||||
}
|
||||
exec {
|
||||
workingDir buildDir
|
||||
commandLine './main'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user