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.
This commit is contained in:
fermionoid
2026-07-16 18:11:45 +08:00
parent d4b4f33f22
commit 85c7857fe2
+1 -1
View File
@@ -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)