[Emergency Fix]Compile Property Graph with `ENABLE_JAVA_SDK` on needs `jni.h`
@@ -184,6 +184,15 @@ find_package(OpenMP QUIET)
set(ANALYTICAL_ENGINE_FRAME_DIR "${ANALYTICAL_ENGINE_HOME}/include/graphscope/frame")
set(FRAME_NAME $_frame_name)
+# include jni------------------------------------------------------------------
+if(PROPERTY_GRAPH_FRAME OR JAVA_PIE_APP)
+ if (ENABLE_JAVA_SDK)
+ find_package(JNI REQUIRED)
+ include_directories(SYSTEM ${JAVA_INCLUDE_PATH})
+ include_directories(SYSTEM ${JAVA_INCLUDE_PATH2})
+ endif()
+endif()
+
# set javasdk.cc--------------------------------------------------------------
if(EXISTS "${ANALYTICAL_ENGINE_HOME}/core/java/javasdk.cc")
set(ANALYTICAL_JAVASDK_CC "${ANALYTICAL_ENGINE_HOME}/core/java/javasdk.cc")
@@ -282,11 +291,6 @@ elseif (CYTHON_PIE_APP)
set_target_properties(${FRAME_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
elseif (JAVA_PIE_APP)
if (ENABLE_JAVA_SDK)
- # include jni------------------------------------------------------------------
- find_package(JNI REQUIRED)
- include_directories(SYSTEM ${JAVA_INCLUDE_PATH})
- include_directories(SYSTEM ${JAVA_INCLUDE_PATH2})
-
#check whether we are using clang.
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "Using Clang compiler: ${CMAKE_CXX_COMPILER}")
