Add Nintendo Switch support through CMake
This commit is contained in:
parent
5b4f91b161
commit
7301893152
26
.github/workflows/build-switch.yml
vendored
Normal file
26
.github/workflows/build-switch.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
name: Build for Nintendo Switch using CMake provided by devkitPro
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
release:
|
||||
types: published
|
||||
jobs:
|
||||
build-nintendo-switch:
|
||||
runs-on: ubuntu-latest
|
||||
container: devkitpro/devkita64:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: "Build files"
|
||||
run: |
|
||||
/opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-cmake -S. -Bbuild .. -DLIBRW_PLATFORM=GL3 -DLIBRW_GL3_GFXLIB=GLFW -DLIBRW_INSTALL=True
|
||||
cmake --build build -j
|
||||
- name: "Create binary package (cpack)"
|
||||
working-directory: ./build
|
||||
run: |
|
||||
cpack
|
||||
- name: "Archive binary package (github artifacts)"
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: "switch-gl3"
|
||||
path: build/*.tar.xz
|
||||
if-no-files-found: error
|
@ -100,6 +100,8 @@ if(LIBRW_INSTALL)
|
||||
set(os "-apple")
|
||||
elseif(UNIX)
|
||||
set(os "-linux")
|
||||
elseif(NINTENDO_SWITCH)
|
||||
set(os "-switch")
|
||||
else()
|
||||
set(compiler "-UNK")
|
||||
message(WARNING "Unknown os. Created cpack package will be wrong. (override using cpack -P)")
|
||||
|
@ -148,13 +148,16 @@ set_target_properties(librw
|
||||
)
|
||||
|
||||
if(LIBRW_PLATFORM_GL3)
|
||||
set(OpenGL_GL_PREFERENCE GLVND)
|
||||
find_package(OpenGL REQUIRED)
|
||||
if(NOT NINTENDO_SWITCH)
|
||||
set(OpenGL_GL_PREFERENCE GLVND)
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
target_link_libraries(librw
|
||||
PUBLIC
|
||||
OpenGL::GL
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(librw
|
||||
PUBLIC
|
||||
OpenGL::GL
|
||||
)
|
||||
if (LIBRW_GL3_GFXLIB STREQUAL "GLFW")
|
||||
find_package(glfw3 REQUIRED)
|
||||
target_link_libraries(librw
|
||||
@ -175,6 +178,15 @@ if(LIBRW_PLATFORM_GL3)
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NINTENDO_SWITCH)
|
||||
target_link_libraries(librw
|
||||
PUBLIC
|
||||
EGL
|
||||
glapi
|
||||
drm_nouveau
|
||||
)
|
||||
endif()
|
||||
elseif(LIBRW_PLATFORM_D3D9)
|
||||
target_link_libraries(librw
|
||||
PUBLIC
|
||||
|
Loading…
Reference in New Issue
Block a user