Files
RetroArch/samples/runloop/hw_context_request/Makefile
LibretroAdmin 1dd09770e5 SET_HW_RENDER: grant GLES versions the device can give
GLES requests are checked against one ceiling: the device's own
ro.opengles.version on Android, the build's GLES level elsewhere or
when the property cannot be read. The regular Android flavors now
grant OPENGLES_VERSION 3.1 and 3.2 on devices that have them, so a
core probing down from 3.2 stops at the version the context really
gives, and a device below a requested version still refuses it and
lets the core fall back. GLES2 builds take 3.0 as their ceiling, the
level they already grant through OPENGLES3.

samples/runloop/hw_context_request drives the request function under
a GLES2 build with the property stubbed, a GLES3.2 build and a GLES3
build.

Refs #19894
2026-10-20 21:49:42 +02:00

36 lines
1.3 KiB
Makefile

TARGET := hw_context_request_test
ROOT := ../../..
SOURCES := hw_context_request_test.c $(ROOT)/libretro-common/compat/compat_strl.c
CFLAGS += -O2 -g1 -std=gnu89 -Wall -flto \
-ffunction-sections -fdata-sections \
-I$(ROOT) -I$(ROOT)/menu -I$(ROOT)/libretro-common/include $(EXTRA_CFLAGS)
LDFLAGS += -flto -Wl,--gc-sections
ifneq ($(SANITIZER),)
CFLAGS += -fsanitize=$(SANITIZER) -fno-omit-frame-pointer
LDFLAGS += -fsanitize=$(SANITIZER)
endif
GLES := -DHAVE_OPENGL -DHAVE_OPENGLES
# The regular Android flavors: GLES2 headers, device property read.
# The stub directory stands in for the NDK's sys/system_properties.h.
VARIANT_gles2_prop := $(GLES) -DHAVE_OPENGLES2 \
-DRUNLOOP_GLES_VERSION_PROPERTY \
-I$(ROOT)/tools/platform_stubs/android
VARIANT_gles32 := $(GLES) -DHAVE_OPENGLES3 -DHAVE_OPENGLES3_1 -DHAVE_OPENGLES3_2
VARIANT_gles3 := $(GLES) -DHAVE_OPENGLES3
VARIANTS := gles2_prop gles32 gles3
EXE :=
all: $(foreach v,$(VARIANTS),$(TARGET)_$(v)$(EXE))
$(TARGET)_%$(EXE): $(SOURCES) $(ROOT)/runloop.c $(ROOT)/runloop.h
$(CC) $(CFLAGS) $(VARIANT_$*) $(SOURCES) -o $@ $(LDFLAGS)
check: all
@for v in $(VARIANTS); do echo "== $$v"; ./$(TARGET)_$$v$(EXE) || exit 1; done
clean:
rm -f $(foreach v,$(VARIANTS),$(TARGET)_$(v) $(TARGET)_$(v).exe)
.PHONY: all check clean