...
 
Commits (4)
variables:
PACKAGE_FOLDER: "fmsx"
stages:
- package
package:
stage: package
image: starcarr/libnx:latest
script:
- sh build.sh $PACKAGE_FOLDER master
artifacts:
name: $PACKAGE_FOLDER
paths:
- $PACKAGE_FOLDER
only:
- master
nightly:
stage: package
image: starcarr/libnx:nightly
script:
- sh build.sh $PACKAGE_FOLDER develop
artifacts:
name: $PACKAGE_FOLDER
expire_in: 24 hours
paths:
- $PACKAGE_FOLDER
except:
- master
......@@ -200,6 +200,22 @@ else ifeq ($(platform), wii)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
PLATFORM_DEFINES += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DMSB_FIRST
STATIC_LINKING = 1
# Nintendo Switch (libnx)
else ifeq ($(platform), switch)
#include $(DEVKITPRO)/libnx/switch_rules
CC = $(DEVKITPRO)/devkitA64/bin/aarch64-none-elf-gcc
CXX = $(DEVKITPRO)/devkitA64/bin/aarch64-none-elf-g++
AR = $(DEVKITPRO)/devkitA64/bin/aarch64-none-elf-ar
TARGET := $(TARGET_NAME)_libretro_$(platform).a
ARCH := arm64
CFLAGS += -O3 -fomit-frame-pointer -ffast-math -I$(DEVKITPRO)/libnx/include/ -fPIE -Wl,--allow-multiple-definition
CFLAGS += -specs=$(DEVKITPRO)/libnx/switch.specs
CFLAGS += -D__SWITCH__
CFLAGS += -DARM -D__aarch64__=1 -march=armv8-a -mtune=cortex-a57 -mtp=soft -DINLINE=inline -ffast-math -mcpu=cortex-a57+crc+fp+simd -ffunction-sections
CFLAGS += -Ifrontend/switch -ftree-vectorize
STATIC_LINKING=1
else ifneq (,$(findstring armv,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
......
#!/bin/bash
PACKAGE_FOLDER=$1
BRANCH=$2
LIBRARY_NAME="fmsx_libretro_switch.a"
NRO_NAME="fmsx.nro"
APP_TITLE="fMSX libnx"
mkdir $PACKAGE_FOLDER
make platform=switch -j10 -f Makefile
git clone -b $BRANCH https://git.m4xw.net/Switch/RetroArch/RetroArch.git --depth=1
cp $LIBRARY_NAME RetroArch/libretro_switch.a
cp assets/icon.jpg RetroArch/icon.jpg
cd RetroArch/
mkdir romfs
APP_TITLE="$APP_TITLE" make -f Makefile.switch -j10
cp retroarch_switch.nro ../$PACKAGE_FOLDER/$NRO_NAME