From 74b5ec00dc18d534dcc3442b1c23ee0ada2738ec Mon Sep 17 00:00:00 2001 From: Noel Eck Date: Mon, 22 Jan 2018 16:40:56 -0800 Subject: [PATCH] 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 --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f440c472..eb6f6a6b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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}"