Interop: do not use hardcoded paths to LLVM

also use the defined LLVM toolchain to build JNI interop stub libs
This commit is contained in:
Svyatoslav Scherbina
2016-09-26 14:02:51 +03:00
parent f9f418c51b
commit 1a83fce002
7 changed files with 30 additions and 16 deletions
+5
View File
@@ -42,3 +42,8 @@ sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
genInteropStubs {
environment 'CPATH' : "$llvmInstallPath/include"
environment 'LIBRARY_PATH' : "$llvmInstallPath/lib"
}
@@ -3,27 +3,27 @@ libName = llvmbridge
headers = llvm-c/Core.h llvm-c/ExecutionEngine.h llvm-c/Target.h llvm-c/Analysis.h llvm-c/BitWriter.h
compiler = cc
compiler = clang
compilerOpts = -std=c99 -I/opt/local/libexec/llvm-3.8/include -fPIC \
compilerOpts = -std=c99 -fPIC \
-Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers \
-pedantic -Wno-long-long -Wcovered-switch-default -Wdelete-non-virtual-dtor \
-DNDEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
linker = c++
linker = clang++
linkerOpts = -stdlib=libc++ -fPIC -fvisibility-inlines-hidden \
-Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers \
-pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor \
-std=c++11 \
-DNDEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS \
-L/opt/local/libexec/llvm-3.8/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names \
-Wl,-search_paths_first -Wl,-headerpad_max_install_names \
-lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter \
-lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMInterpreter \
-lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMInstrumentation -lLLVMProfileData -lLLVMTransformUtils \
-lLLVMBitWriter -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser \
-lLLVMBitReader -lLLVMMC -lLLVMCore -lLLVMSupport -lcurses -lpthread -lz -lm \
-L/opt/local/lib -lffi
-lffi
excludedFunctions =