Skip to content

Commit

Permalink
Add custom JNI_INCLUDE_DIRS for Windows only
Browse files Browse the repository at this point in the history
Signed-off-by: utzcoz <utzcoz@outlook.com>
  • Loading branch information
utzcoz committed Dec 6, 2021
1 parent f40cea1 commit 29bad52
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nativeruntime/cpp/CMakeLists.txt
Expand Up @@ -8,7 +8,15 @@ set (CMAKE_CXX_STANDARD 17)

project(nativeruntime)

find_package(JNI REQUIRED)
if (WIN32)
if(NOT DEFINED ENV{JAVA_HOME})
message(FATAL_ERROR "JAVA_HOME is required in Windows")
endif()
# find_package JNI is broken on Windows, manually include header files
set(JNI_INCLUDE_DIRS "$ENV{JAVA_HOME}/include" "$ENV{JAVA_HOME}/include/win32")
else()
find_package(JNI REQUIRED)
endif()

set(ANDROID_SQLITE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../external/sqlite")

Expand Down

0 comments on commit 29bad52

Please sign in to comment.