Commit Graph
2 Commits
Author SHA1 Message Date
libretroadmin afbad7a104 samples: shared sources build into each sample's own obj/
Samples compiled shared tree sources in place, so whichever sample ran
next linked those objects with the flags they were built with, as
unity_identity did with mic_handshake's ASan objects. Every sample that
builds a source from outside its directory now includes
sample_objdir.mk and maps those objects under its own obj/; its own
objects stay where they were. The rule for the mapped objects has a
slash in its target, so make 3.81 does not strip the directory.

tools/sample_objdir_check.py dry-runs every sample Makefile and fails
on an object written outside the sample; the Samples-Objdir-Check
workflow runs it.
2026-10-10 19:43:34 +02:00
F 4845f3b13f (Widgets) Fix the sanitize sample, and add a way to catch this
f7bb668 made gfx_widgets.c call font_driver_language_font_file(), and
samples/gfx/gfx_widgets_sanitize stubs the font driver out rather than
linking it, so the sample stopped linking:

  gfx_widgets.c:1019: undefined reference to
      `font_driver_language_font_file'

Stubbed, returning NULL - those tests are about widget layout, not the
language mapping. Also drops a glyph_width left unused when 41bcd2a
moved the metric computation into gfx_widgets_font_sync().

This is the second time a change of mine has broken that sample the
same way, and both times CI found it rather than I did. The reason is
that there was no way to build the samples in one go: 29 of them, each
with its own Makefile, so checking "the one I remember touching" is
what happens, and the one I did not remember is the one that breaks.

samples/Makefile builds them all:

    make -C samples          build every sample
    make -C samples check    build and run every sample
    make -C samples check SAN=thread

It cleans each sample before building it, which is not optional: the
samples compile shared sources into the same object paths under gfx/
and libretro-common/, so one sample's objects get picked up by the
next and fail its link. Without the clean, eight of them appear broken
that are not.

Every sample builds except gfx/display_servers_kms, which wants libdrm
headers.
2026-08-08 20:43:26 +02:00