From 85c7857fe2b7958681d63ba6639830ea7db94fd7 Mon Sep 17 00:00:00 2001 From: fermionoid Date: Thu, 16 Jul 2026 18:11:45 +0800 Subject: [PATCH] Makefile: add -std=gnu++17 to METALXX for Apple clang 16 Apple clang 16 (clang-1600.0.26.6) defaults objective-c++ to a pre-C++11 dialect, so the raw string literal holding the Metal shader in backend_metal.mm fails to parse: backend_metal.mm:12:29: error: use of undeclared identifier 'R' backend_metal.mm:13:10: fatal error: 'metal_stdlib' file not found Pinning gnu++17 on METALXX fixes 'make glm METAL=1' and 'make metal-test'. Verified on macOS 15 / M4 Max: both targets build and all metal backend tests pass. --- c/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/Makefile b/c/Makefile index 1ed6df6..ccf0a3c 100644 --- a/c/Makefile +++ b/c/Makefile @@ -197,7 +197,7 @@ endif # runtime, so no Xcode / offline metal compiler is required. Default build unchanged. METAL ?= 0 METAL_OBJ = -METALXX = clang++ -x objective-c++ -fobjc-arc -O3 +METALXX = clang++ -x objective-c++ -std=gnu++17 -fobjc-arc -O3 ifeq ($(METAL),1) ifeq (,$(DARWIN)) $(error METAL=1 is supported only on macOS)