summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWANG Xuerui <xen0n@gentoo.org>2024-08-13 08:06:38 (GMT)
committerBrad King <brad.king@kitware.com>2024-08-15 13:41:57 (GMT)
commit983291669dade10e5225389b07f6a7329d9c2d3a (patch)
tree894a1cd953e38de7861bb86c625e5889abde1e64
parent3265458a7902ea4c86572349556bde165d183a50 (diff)
downloadCMake-983291669dade10e5225389b07f6a7329d9c2d3a.zip
CMake-983291669dade10e5225389b07f6a7329d9c2d3a.tar.gz
CMake-983291669dade10e5225389b07f6a7329d9c2d3a.tar.bz2
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: https://github.com/openjdk/jdk/commit/8fbcc8239a3fc04e56ebbd287c7bb5db731977b7 Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1078446
-rw-r--r--Modules/FindJNI.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index abc76cf..51f05b9 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -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"