Tests: enable Java tests if javac is a recurse symlink

There are distros (OS Elbrus 6.x, 7.x, Ubuntu 21.x)
where javac is a recurse symlink, like /usr/bin/javac ->
/etc/alternatives/javac -> /usr/lib/jvm/.../bin/javac.
On these distros, Java tests were not run, because
Tests/CMakeLists.txt was not able to handle this case
correctly. Now an additional stage of resolving symlinks
is added, and these distros have Java tests running.
This commit is contained in:
makise-homura
2022-06-23 02:08:40 +03:00
committed by Brad King
parent 7545d1ca9f
commit 070e217399

View File

@@ -3371,7 +3371,8 @@ if(BUILD_TESTING)
set(JavaExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM})
ADD_TEST_MACRO(JavaExportImport JavaExportImport)
get_filename_component(JNIPATH ${Java_JAVAC_EXECUTABLE} PATH)
get_filename_component(JAVACPATH ${Java_JAVAC_EXECUTABLE} REALPATH)
get_filename_component(JNIPATH ${JAVACPATH} PATH)
find_file(JNI_H jni.h
"${JNIPATH}/../include"
"${JNIPATH}/../java/include")