Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 63 additions & 17 deletions .github/workflows/build-switch.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<img src="https://github.com/mrxenginner/reVC/blob/miami/res/images/logo_1024.png?raw=true" alt="reVC logo" width="200">

[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmrxenginner%2FreVC%2Fbadge%3Fref%3Dmiami&style=flat)](https://actions-badge.atrox.dev/mrxenginner/reVC/goto?ref=miami)
<a href="https://discord.gg/RFNbjsUMGg"><img src="https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat" /></a>

## Intro

In this repository you'll find the fully reversed source code for GTA VC ([miami](https://github.com/mrxenginner/reVC/tree/miami/) branch).
Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down