aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-25 22:10:44 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-25 22:10:44 +0200
commit03c67a8832ef3469a6dba08436edac3f9b080aec (patch)
treeae4b3824cf8cff629fa93cb943ab9e74d083b055 /Makefile
parent9fd8d4a0a062d0e8fa19a84f8597b08bc40487dc (diff)
limit silencing of memory-access warning for recent JDKs
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d071eed..5d5e771 100644
--- a/Makefile
+++ b/Makefile
@@ -10,12 +10,18 @@ ZIPFILES += $(STEMS:=.java)
include _make/*.mk
+# resolve Java version
+JAVA_MAJOR_VERSION := $(shell $(JAVA) -version 2>&1 \
+ | grep -Pom1 '"\K\d+' )
+
# silence security restriction warning
JAVAFLAGS += --enable-native-access=javafx.graphics
-# silence warnig specific to JDK 23-24
+# silence unsafe memory-access methods warning on recent JDKs
# @see <https://stackoverflow.com/a/79526038/18619283>
+ifeq ($(shell expr $(JAVA_MAJOR_VERSION) \>= 23), 1)
JAVAFLAGS += --sun-misc-unsafe-memory-access=allow
+endif
all:: render