From 087c140e402516aaa6ac2a78398ec687c7b556ae Mon Sep 17 00:00:00 2001 From: Craig Carnell <1188869+cscd98@users.noreply.github.com> Date: Fri, 27 Nov 2026 21:29:39 +0000 Subject: [PATCH] libretro: add Switch 2 (libounce) to CI --- .gitlab-ci.yml | 12 +++++++++++- Makefile | 15 ++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd698d6..5cdda62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,7 +85,11 @@ include: # Nintendo Switch - project: 'libretro-infrastructure/ci-templates' file: '/libnx-static.yml' - + + # Nintendo Switch 2 + - project: 'libretro-infrastructure/ci-templates' + file: '/libounce-make.yml' + # PlayStation Portable - project: 'libretro-infrastructure/ci-templates' file: '/psp-static.yml' @@ -278,6 +282,12 @@ libretro-build-libnx-aarch64: - .libretro-libnx-static-retroarch-master - .core-defs +# Nintendo Switch 2 +libretro-build-libounce-aarch64: + extends: + - .libretro-libounce-make-aarch64 + - .core-defs + # RetroFW libretro-build-retrofw-mips32: extends: diff --git a/Makefile b/Makefile index 2645330..230ae29 100644 --- a/Makefile +++ b/Makefile @@ -213,6 +213,15 @@ else ifeq ($(platform), libnx) CFLAGS += -std=gnu11 STATIC_LINKING = 1 +# Nintendo Switch 2 (libounce) +else ifeq ($(platform), libounce) + include $(DEVKITPRO)/libounce/switch2_rules + TARGET := $(TARGET_NAME)_libretro_$(platform).elf + TARGET_NRO := $(TARGET:.elf=.nro) + fpic := -fPIC + SHARED := -shared -Wl,--version-script=$(CORE_DIR)/link.T -Wl,--no-undefined + LDFLAGS += -Wl,-soname,$(TARGET_NRO) + # Nintendo WiiU else ifeq ($(platform), wiiu) TARGET := $(TARGET_NAME)_libretro_$(platform).a @@ -640,6 +649,10 @@ INCFLAGS += $(INCFLAGS_PLATFORM) all: $(TARGET) +ifeq ($(platform), libounce) +all: $(TARGET_NRO) +endif + $(TARGET): $(OBJECTS) ifeq ($(STATIC_LINKING),1) ifneq (,$(findstring msvc,$(platform))) @@ -655,4 +668,4 @@ endif $(CC) -c $(OBJOUT)$@ $< $(CFLAGS) $(INCFLAGS) clean: - rm -f $(OBJECTS) $(TARGET) + rm -f $(OBJECTS) $(TARGET) $(TARGET_NRO)