Java: Added an unresolved symbol check for Java packages

Tell the linker to error on unresolved symbols.  This enables future
Java work (removing library source from Java packages) by flagging
missing reference.s

TODO: Move this up one level to all libraries.  The reason this was not
done in the same commit is that the NodeJs libraries contain unresolved
references which must come from node but remain unresolved in the NodeJs
packages.

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck 2018-01-22 16:40:56 -08:00
parent abefdfc756
commit 74b5ec00dc

View File

@ -457,7 +457,9 @@ function(upm_swig_java)
# target .jar file in the classpath, otherwise this variable will be empty
set (INTERFACES_JAR_FILE ${CMAKE_BINARY_DIR}/src/interfaces/upm_interfaces.jar)
endif ()
swig_link_libraries (javaupm_${libname} ${MRAAJAVA_LIBRARY} ${JAVA_LIBRARIES} ${libname})
# For linker to report unresolved symbols. Note, there is currently no test
# for linker flags (similar to compile files), so this is it for now.
swig_link_libraries (javaupm_${libname} ${MRAAJAVA_LIBRARY} ${JAVA_LIBRARIES} ${libname} -Wl,--unresolved-symbols=report-all)
target_include_directories ( ${SWIG_MODULE_javaupm_${libname}_REAL_NAME}
PUBLIC
"${JAVA_INCLUDE_DIRS}"