Skip to content

Commit 1b87350

Browse files
committed
Only require jni.h to be found when searching for the JNI
Before this patch, we would only add the jni.h include path if both JNI and AWT were found as FindJNI.cmake only sets JNI_FOUND if both JNI and AWT were found, requiring you to install openjdk-11-jdk instead of openjdk-11-jdk-headless for the build to succeed. After this patch both the headless and the full jdk is fine. See: https://cmake.org/cmake/help/v3.22/module/FindJNI.html
1 parent e729f6a commit 1b87350

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ find_package(Protobuf REQUIRED)
4040
include_directories(${PROTOBUF_INCLUDE_DIRS})
4141

4242
find_package(JNI)
43-
if(JNI_FOUND)
44-
include_directories(${JNI_INCLUDE_DIRS})
43+
if(JAVA_INCLUDE_PATH)
44+
include_directories(${JAVA_INCLUDE_PATH})
4545
endif()
4646

4747
include_directories("src")

0 commit comments

Comments
 (0)