diff --git a/.github/workflows/build-switch.yml b/.github/workflows/build-switch.yml
index c27216ab1..9855244c8 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
- cmake --build build --parallel
- - name: "Create binary package (cpack)"
- working-directory: ./build
+ 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: |
- cpack
- - name: "Archive binary package (github artifacts)"
+ /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: 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 6d93ae4b6..9662a9a25 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 91d3b8f69..ee6376c15 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)