Skip to content

Commit

Permalink
Allow JNI build on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jserv committed Mar 16, 2018
1 parent 81819df commit cd0df10
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ CFLAGS += \
LDFLAGS += -L$(OPENCL_LIB) -lOpenCL
endif

# FIXME: avoid hardcoded OS path
ifneq ("$(DISABLE_JNI)","1")
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
JAVA_HOME := $(shell /usr/libexec/java_home)
CFLAGS_JNI = \
-I$(JAVA_HOME)/include \
-I$(JAVA_HOME)/include/darwin
else
# Default to Linux
CFLAGS_JNI = \
-I$(OPENJDK_PATH)/include \
-I$(OPENJDK_PATH)/include/linux
endif
endif

TESTS = \
trinary \
Expand Down

0 comments on commit cd0df10

Please sign in to comment.