mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-23 09:49:34 -10:00
The sample and test builds used full debug info. -g1 keeps what sanitizer reports and backtraces need - function names, files and line numbers - and drops the variable and type information nobody reads in CI. Objects get about 30% smaller (rh265.o under ASan+UBSan: 5.1MB to 3.7MB), so the ccache caches hold more of each job's build and are quicker to restore and save.
44 lines
1.2 KiB
Makefile
44 lines
1.2 KiB
Makefile
TARGET := x11_input_poll_test
|
|
|
|
# Builds the real input/drivers/x11_input.c (included by the test so
|
|
# it can reach the driver's state) and gfx/common/x11_common.c against
|
|
# libX11, and drives the keyboard through XTEST on whatever $DISPLAY
|
|
# points at (Xvfb in CI).
|
|
REPO_ROOT := ../../..
|
|
|
|
SOURCES := x11_input_poll_test.c \
|
|
$(REPO_ROOT)/input/common/input_x11_common.c \
|
|
$(REPO_ROOT)/gfx/common/x11_common.c \
|
|
$(REPO_ROOT)/libretro-common/compat/compat_strl.c \
|
|
$(REPO_ROOT)/libretro-common/encodings/encoding_utf.c
|
|
|
|
CFLAGS += -Wall -g1 -O0 -DHAVE_X11 -DHAVE_XI2 \
|
|
-I$(REPO_ROOT) \
|
|
-I$(REPO_ROOT)/libretro-common/include
|
|
|
|
LDLIBS += -lXtst -lXi -lX11
|
|
|
|
OBJS := $(addprefix obj/,$(notdir $(SOURCES:.c=.o)))
|
|
VPATH := $(sort $(dir $(SOURCES)))
|
|
|
|
obj/x11_input_poll_test.o: CFLAGS += -std=c89 -pedantic -Wno-long-long
|
|
|
|
ifneq ($(SANITIZER),)
|
|
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
|
|
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
|
endif
|
|
|
|
all: $(TARGET)
|
|
|
|
obj/%.o: %.c
|
|
@mkdir -p obj
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
|
|
|
|
clean:
|
|
rm -rf $(TARGET) obj
|
|
|
|
.PHONY: clean
|