Improved JNI flag hanling in CMake
This commit is contained in:
@@ -195,40 +195,17 @@ target_link_libraries (nativetest lwip zto zt)
|
||||
|
||||
# --- CONFIGURATION
|
||||
|
||||
if (LIBZT_TRACE EQUAL 1)
|
||||
set (LIBZT_DEFS "${LIBZT_DEFS} -DLIBZT_TRACE=1")
|
||||
endif()
|
||||
if (LIBZT_DEBUG EQUAL 1)
|
||||
set (LIBZT_DEFS "${LIBZT_DEFS} -DLIBZT_DEBUG=1")
|
||||
endif()
|
||||
if (ZT_TRACE EQUAL 1)
|
||||
set (ZT_DEFS "${ZT_DEFS} -DZT_TRACE=1")
|
||||
endif()
|
||||
if (ZT_DEBUG EQUAL 1)
|
||||
set (ZT_DEFS "${ZT_DEFS} -DZT_DEBUG=1")
|
||||
endif()
|
||||
if (NS_TRACE EQUAL 1)
|
||||
set (NS_DEFS "${NS_DEFS} -DNS_TRACE=1")
|
||||
endif()
|
||||
if (NS_DEBUG EQUAL 1)
|
||||
set (NS_DEFS "${NS_DEFS} -DNS_DEBUG=1")
|
||||
endif()
|
||||
|
||||
if (JNI EQUAL 1)
|
||||
MESSAGE (STATUS "Looking for JNI headers")
|
||||
# --- Locate JNI headers
|
||||
find_package (JNI)
|
||||
if (JNI_FOUND)
|
||||
message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
|
||||
message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}")
|
||||
list (GET JNI_INCLUDE_DIRS 0 JNI_INCLUDE_DIR)
|
||||
message (STATUS "chosen=${JNI_INCLUDE_DIR}")
|
||||
message (STATUS "jni path=${JNI_INCLUDE_DIR}")
|
||||
include_directories ("${JNI_INCLUDE_DIR}")
|
||||
else()
|
||||
message (STATUS "JNI not found")
|
||||
endif()
|
||||
target_compile_options (zt PRIVATE -std=c++11 -DZT_SDK=1 -DLIBZT_TRACE=1 -DSDK_JNI=1)
|
||||
# JNI
|
||||
option (USE_JNI
|
||||
"Use Java JNI for shared/dynamic libraries" ON)
|
||||
add_definitions(-DSDK_JNI=1)
|
||||
endif()
|
||||
Reference in New Issue
Block a user