From 1e41b490b718a440d8139c997388c5c309834d57 Mon Sep 17 00:00:00 2001
From: Stevens <45856578+StevensND@users.noreply.github.com>
Date: Tue, 1 Sep 2026 07:07:34 +0200
Subject: [PATCH] Update Nintendo Switch Support + CI Workflow (#39)
* Update CMakeLists.txt
* Update build-switch.yml
* Update README by removing badges
Removed build status and Discord badge from README.
---
.github/workflows/build-switch.yml | 80 +++++++++++++++++++++++-------
README.md | 3 --
src/CMakeLists.txt | 7 +++
3 files changed, 70 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/build-switch.yml b/.github/workflows/build-switch.yml
index c27216ab..9855244c 100644
--- a/.github/workflows/build-switch.yml
+++ b/.github/workflows/build-switch.yml
@@ -1,29 +1,75 @@
+name: Build reVC.nro (Nintendo Switch)
-name: reVC cmake devkitA64 (Nintendo Switch)
on:
- pull_request:
push:
- release:
- types: published
+ pull_request:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Release version. Leave it empty to avoid publishing a release.'
+ required: false
+ type: string
+
jobs:
- build-nintendo-switch:
+ build:
runs-on: ubuntu-latest
- container: devkitpro/devkita64:latest
+ container:
+ image: devkitpro/devkita64:latest
+ options: --user root
+
steps:
- - uses: actions/checkout@v4
+ - name: Checkout repository
+ uses: actions/checkout@v4
with:
- submodules: 'true'
- - name: "Build files"
+ submodules: 'recursive'
+
+ - name: Install required Switch libraries
run: |
- /opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-cmake -S. -Bbuild -DREVC_AUDIO=OAL -DLIBRW_PLATFORM=GL3 -DLIBRW_GL3_GFXLIB=GLFW -DREVC_WITH_OPUS=False -DREVC_VENDORED_LIBRW=True -DREVC_INSTALL=True
+ dkp-pacman -S --noconfirm --needed \
+ switch-mesa \
+ switch-libdrm_nouveau \
+ switch-glfw \
+ switch-glm \
+ switch-libpng \
+ switch-mpg123 \
+ switch-openal-soft \
+ switch-sdl2
+
+ - name: Build
+ run: |
+ /opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-cmake -S. -Bbuild \
+ -DREVC_AUDIO=OAL -DLIBRW_PLATFORM=GL3 -DLIBRW_GL3_GFXLIB=GLFW \
+ -DREVC_WITH_OPUS=False -DREVC_VENDORED_LIBRW=True -DREVC_INSTALL=True
cmake --build build --parallel
- - name: "Create binary package (cpack)"
- working-directory: ./build
- run: |
- cpack
- - name: "Archive binary package (github artifacts)"
+
+ - name: Collect NRO
+ run: find build -name 'reVC.nro' -exec cp {} reVC.nro \;
+
+ - name: Upload artifact
uses: actions/upload-artifact@v4
with:
- name: "switch-gl3"
- path: build/*.tar.xz
+ name: reVC-switch
+ path: reVC.nro
if-no-files-found: error
+
+ release:
+ needs: build
+ runs-on: ubuntu-latest
+ if: github.event_name == 'workflow_dispatch' && inputs.version != ''
+ permissions:
+ contents: write
+
+ steps:
+ - name: Download build artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: reVC-switch
+
+ - name: Create GitHub Release
+ uses: softprops/action-gh-release@v2
+ with:
+ tag_name: "v${{ inputs.version }}"
+ name: "reVC v${{ inputs.version }}"
+ files: reVC.nro
+ draft: false
+ prerelease: false
diff --git a/README.md b/README.md
index 6d93ae4b..9662a9a2 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,5 @@
-[](https://actions-badge.atrox.dev/mrxenginner/reVC/goto?ref=miami)
-
-
## Intro
In this repository you'll find the fully reversed source code for GTA VC ([miami](https://github.com/mrxenginner/reVC/tree/miami/) branch).
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 91d3b8f6..ee6376c1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -93,6 +93,13 @@ if(${PROJECT}_AUDIO STREQUAL "OAL")
target_compile_definitions(${EXECUTABLE} PRIVATE ${OPENAL_DEFINITIONS})
endif()
target_compile_definitions(${EXECUTABLE} PRIVATE AUDIO_OAL)
+ # Nintendo Switch: devkitPro's OpenAL is built with an SDL2 audio backend,
+ # so libopenal.a references SDL_* symbols that must be linked in after it.
+ if(NINTENDO_SWITCH)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
+ target_link_libraries(${EXECUTABLE} PRIVATE PkgConfig::SDL2)
+ endif()
elseif(${PROJECT}_AUDIO STREQUAL "MSS")
find_package(MilesSDK REQUIRED)
target_compile_definitions(${EXECUTABLE} PRIVATE AUDIO_MSS)