java: mraa jni library now dynamically links to libmraa
libmraajava.so was statically linking to mraa object files causing duplicate mraa platform instances if a UPM Java module was also loaded. JNI functionality has been moved into src/java/mraajni.c. JVM object is now set when JVM is loaded; see updates to src/java/mraajava.i. This was necessary as the JVM object cannot be directly referenced from mraa as it will not be available when building C/C++ examples. Signed-off-by: Henry Bruce <henry.bruce@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
0633cd4145
commit
9d497e08cd
@@ -1,11 +1,3 @@
|
||||
FIND_PACKAGE (JNI REQUIRED)
|
||||
|
||||
include_directories (
|
||||
${JAVA_INCLUDE_PATH}
|
||||
${JAVA_INCLUDE_PATH2}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
)
|
||||
|
||||
# SWIG treats SWIG_FLAGS as a list and not a string so semicolon seperation is required
|
||||
set_source_files_properties (mraajava.i PROPERTIES SWIG_FLAGS ";-package;mraa;-I${CMAKE_BINARY_DIR}/src")
|
||||
set_source_files_properties (mraajava.i PROPERTIES CPLUSPLUS ON)
|
||||
@@ -25,8 +17,8 @@ else ()
|
||||
set (JAR $ENV{JAVA_HOME_NATIVE}/bin/jar)
|
||||
endif ()
|
||||
|
||||
swig_add_module (mraajava java mraajava.i ${mraa_LIB_SRCS})
|
||||
swig_link_libraries (mraajava ${JAVA_LIBRARIES} ${mraa_LIBS})
|
||||
swig_add_module (mraajava java mraajava.i)
|
||||
swig_link_libraries (mraajava ${JAVA_LIBRARIES} mraa)
|
||||
|
||||
add_custom_command (TARGET mraajava
|
||||
POST_BUILD
|
||||
|
||||
Reference in New Issue
Block a user