Do not move libclang out from the clang distribution

Also load libclang using the absolute path to simplify cinterop
This commit is contained in:
Svyatoslav Scherbina
2017-04-25 15:38:13 +03:00
committed by SvyatoslavScherbina
parent ab392bf9ed
commit 8ebc0bd1ea
4 changed files with 3 additions and 25 deletions
@@ -186,6 +186,9 @@ private fun Properties.defaultCompilerOpts(target: String, dependencies: String)
val sysRoot = targetSysRoot
val llvmHomeDir = this.getOsSpecific("llvmHome")!!
val llvmHome = "$dependencies/$llvmHomeDir"
System.load("$llvmHome/lib/${System.mapLibraryName("clang")}")
val llvmVersion = this.getProperty("llvmVersion")!!
val dependencyList = getOsSpecific("dependencies", target)?.split(' ') ?: listOf<String>()
-22
View File
@@ -215,32 +215,10 @@ task dist_compiler(type: Copy) {
into('konan')
}
from("$llvmDir/lib") {
into('konan/nativelib')
include '**/libclang.*'
includeEmptyDirs = false
}
// TODO: check if we use native libraries copied to dist (see above) or not.
from(project(':tools:helpers').file('build/libs')) {
into('konan/lib')
}
doLast {
// MacOS System Integrity Protection strips DYLD_LIBRARY_PATH from
// environment of all the binaries residing in /bin /usr/bin etc.
// That means /usr/bin/java can't use DYLD_LIBRARY_PATH to pick up
// rpath'ed libraries.
// See dyld(1), install_name_tool(1) for rpath details.
if (isMac()) {
exec {
commandLine "install_name_tool"
args '-add_rpath', '@loader_path/',
'dist/konan/nativelib/libclangstubs.dylib'
}
}
}
}
task list_dist(type: Exec) {
@@ -190,8 +190,6 @@ class NamedNativeInteropConfig implements Named {
).asPath
systemProperties "konan.home": project.rootProject.file("dist")
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
environment "DYLD_LIBRARY_PATH": "${project.llvmDir}/lib"
environment "LD_LIBRARY_PATH": "${project.llvmDir}/lib"
outputs.dir generatedSrcDir
outputs.dir nativeLibsDir
-1
View File
@@ -86,7 +86,6 @@ CSTUBSNAME=cstubs
CSTUBSNAME_ARG="-cstubsname $CSTUBSNAME"
LIBCLANG_DISABLE_CRASH_RECOVERY=1 \
LD_LIBRARY_PATH=${NATIVE_LIB} \
$JAVACMD $JAVA_OPTS ${java_args[@]} \
-cp $INTEROP_CLASSPATH \
$INTEROP_TOOL \