Java binding compilation improvement for macos

Tries to get `JAVA_HOME` automatically if not already set
This commit is contained in:
Enrico Del Fante 2022-11-25 10:31:23 +01:00 committed by GitHub
parent c2ed728b70
commit 0caab36c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -8,15 +8,18 @@ ifeq ($(OS),Windows_NT)
LIBRARY_RESOURCE=ckzg4844jni.dll
else
CLANG_EXECUTABLE=clang
GRADLE_COMMAND=./gradlew
GRADLE_COMMAND=./gradlew
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CLANG_FLAGS=-fPIC -shared
CLANG_FLAGS=-fPIC -shared
JNI_INCLUDE_FOLDER=linux
LIBRARY_RESOURCE=libckzg4844jni.so
endif
ifeq ($(UNAME_S),Darwin)
CLANG_FLAGS=-dynamiclib
ifeq ($(JAVA_HOME),)
JAVA_HOME := $(shell /usr/libexec/java_home)
endif
CLANG_FLAGS=-dynamiclib
JNI_INCLUDE_FOLDER=darwin
LIBRARY_RESOURCE=libckzg4844jni.dylib
endif