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
104 changes: 104 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: CMake on multiple platforms

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

# The build matric ensures that the project can build with different compiler/renderer options on multiple systems
# todo: once the project builds without warnings it would be good to treat warnings as errors
matrix:
os: [ubuntu-latest]
renderer: [GL,GLES2,SOFTWARE]
c_compiler: [gcc]
cpp_compiler: [g++]
include:
## Will either need vcpkg to work with clang-cl or for project to build using cl (see #117)
## - os: windows-latest
## c_compiler: clang-cl # Cannot use cl
## cpp_compiler: clang-cl # Cannot use cl
## renderer: GL
## - os: windows-latest
## c_compiler: clang-cl # Cannot use cl
## cpp_compiler: clang-cl # Cannot use cl
## renderer: GLES2
# Ubuntu builds with clang
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
renderer: GL
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
renderer: GLES2
# OSX builds with gcc
- os: macos-latest
c_compiler: gcc
cpp_compiler: g++
renderer: GL
- os: macos-latest
c_compiler: gcc
cpp_compiler: g++
renderer: GLES2
# OSX builds with clang
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
renderer: GL
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
renderer: GLES2

steps:
- uses: actions/checkout@v4

- name: Show CMake Version
run: cmake --version

- name: Apt Install deps (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install libsdl2-dev libglew-dev

- name: Vcpkg Install deps (Windows)
# there is a vcpkg.json in project root
if: startsWith(matrix.os, 'windows')
run: vcpkg install

- name: Brew Install deps (MacOS)
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install sdl2 glew

- name: Show SDL2 config (unix only)
if: ${{ ! startsWith(matrix.os, 'windows') }}
run: |
sdl2-config --cflags
sdl2-config --libs

- name: Configure CMake for ${{ matrix.renderer }} renderer (${{ matrix.c_compiler }})
run: >
cmake -S ${{ github.workspace }}
-B ${{ github.workspace }}/build
-DPLATFORM=SDL2
-DRENDERER=${{ matrix.renderer }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=Release
${{ startsWith(matrix.os, 'macos') && '-DCMAKE_PREFIX_PATH="$(brew --prefix sdl2)"' || '' }}
${{ startsWith(matrix.os, 'windows') && '-DCMAKE_PREFIX_PATH="C:/vcpkg/packages/glew_x64-windows;C:/vcpkg/packages/sdl2_x64-windows"' || '' }}

- name: CMake Build
# Build your program with the given configuration. Note that "--config Release" may be needed on Windows.
run: cmake --build ${{ github.workspace }}/build
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(wipeout-rewrite)

set(CMAKE_C_STANDARD 99) # Align C standard to what's specified in the Makefile: -std=gnu99

if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "In-tree builds are not allowed.")
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/platform_sdl.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <SDL2/SDL.h>
#include "SDL.h"

#include "platform.h"
#include "input.h"
Expand Down
7 changes: 5 additions & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "wipeout-rewrite",
"version-string": "1.0.0",
"description": "re-implementation of the 1995 PSX game wipEout",
"version": "1.0.0",
"builtin-baseline": "0fa8459cf3a7caca7adc58f992bc32ff13630684",
"dependencies": [
{
"name": "sdl2",
"version>=": "2.26.5"
"version>=": "2.28.5",
"default-features": false
},
{
"name": "glew",
Expand Down