FindJNI: Support finding libjvm.so for all OpenJDK variants

Formerly only the "client" and "server" variant directories are being
checked for libjvm.so, but according to a 2021 OpenJDK upstream change
present in OpenJDK >= 18, there can be "minimal" and "zero" variants as
well. In particular, formerly (OpenJDK <= 17) the Zero variant had its
libjvm.so in "server/", but "zero/" in newer versions, which regressed
downstream CMake project builds running on systems with OpenJDK Zero VM.

Fix it by checking all 4 variant directories for libjvm.so.

Link: https://bugs.openjdk.org/browse/JDK-8273494
Link: https://github.com/openjdk/jdk/pull/5440
Link: 8fbcc8239a
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1078446
This commit is contained in:
WANG Xuerui 2024-08-13 16:06:38 +08:00 committed by Brad King
parent 3265458a79
commit 983291669d

View File

@ -343,7 +343,9 @@ foreach(dir IN LISTS JAVA_AWT_LIBRARY_DIRECTORIES)
list(APPEND JAVA_JVM_LIBRARY_DIRECTORIES
"${dir}"
"${dir}/client"
"${dir}/minimal"
"${dir}/server"
"${dir}/zero"
# IBM SDK, Java Technology Edition, specific paths
"${dir}/j9vm"
"${dir}/default"