Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
af54224
build: add cmake
metaq3 Jun 17, 2026
771d631
chore: fix compiler warnings
metaq3 Jun 17, 2026
5495994
chore: add missing files for qvm tools
metaq3 Jun 17, 2026
3a7bbdd
chore: cleanup configuration for gnu-like compilers
metaq3 Jun 17, 2026
0a1f1bc
cicd: add build with cmake
metaq3 Jun 17, 2026
42d27be
fix: use intrinsic debug break instead of inline assembly
metaq3 Jun 17, 2026
122e658
fix: add proper qvm guard against msvc compiling issues
metaq3 Jun 17, 2026
ab9e710
fix: astyle format
metaq3 Jun 17, 2026
fb6f14a
chore: split up msvc and mingw for windows ci
metaq3 Jun 17, 2026
93029dd
fix: minor ci fixes
metaq3 Jun 17, 2026
6328201
fix: properly set dependencies for pk3 and qvms
metaq3 Jun 17, 2026
1da2a11
chore: download catch instead of just requiring it
metaq3 Jun 17, 2026
374da37
fix: define empty id_inline for unknown platforms
metaq3 Jun 17, 2026
b5cf8ed
chore: use ninja as build system for linux ci
metaq3 Jun 17, 2026
f4dcf55
ci: temporarily remove tests
metaq3 Jun 17, 2026
0d272cb
docs: add cmake install section
metaq3 Jun 17, 2026
5fce7a7
ci: temporarily allow creating releases on non-main branch
metaq3 Jun 17, 2026
490e65d
ci: return main branch requirement for releases
metaq3 Jun 17, 2026
6597414
docs: minor naming fixes
metaq3 Jun 17, 2026
1ed576d
fix: always build pk3 to make sure it contains latest assets
metaq3 Jun 18, 2026
aad95de
fix: properly pass parameters to linker
metaq3 Jun 18, 2026
4c8d2e0
chore: prettier tests cmake
metaq3 Jun 18, 2026
870ceb8
chore: pass osp2 configuration via cmake
metaq3 Jun 18, 2026
a7adee8
chore: link math library through native cmake tools
metaq3 Jun 18, 2026
76f4a4b
fix: replace gnu_printf with printf against clang errors
metaq3 Jun 18, 2026
24bf2c6
fix: properly ignore build folder
metaq3 Jun 18, 2026
aabeaaf
ci: return tests
metaq3 Jun 20, 2026
a3ebd67
fix: explicitly compare to null pointer against mingw compilation issues
metaq3 Jun 20, 2026
a760fcb
fix: statically link libraries against mingw32 issues
metaq3 Jun 20, 2026
1e0a6e3
docs: add testing instructions
metaq3 Jun 20, 2026
b128c79
chore: build instructions improvements
metaq3 Jun 20, 2026
d039efc
ci: remove redundant catch2 install
metaq3 Jun 20, 2026
ebdc7ff
ci: return master branch requirement
metaq3 Jun 20, 2026
514f4b6
docs: 7zip notice
metaq3 Jun 20, 2026
0e07218
chore: remove makefile
metaq3 Jun 20, 2026
b84cb69
chore: remove libmvec linkage
metaq3 Jun 20, 2026
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
168 changes: 110 additions & 58 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,71 @@ name: Makefile CI

on:
push:
branches: [ "master" ]
branches: ["master"]
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
- 'docs/*'
- 'build/*'
- 'util/*'
- "**.md"
- "*.txt"
- ".gitignore"
- "docs/*"
- "build/*"
- "util/*"
pull_request:
branches: [ "master" ]
branches: ["master"]
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
- 'docs/*'
- 'build/*'
- 'util/*'
- "**.md"
- "*.txt"
- ".gitignore"
- "docs/*"
- "build/*"
- "util/*"

jobs:
linux:
runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: sudo apt install -y astyle cppcheck catch2
- name: Install dependencies
run: sudo apt install -y astyle cppcheck cmake 7zip

- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/checkout@v4
with:
submodules: recursive

- name: format_check
working-directory: ./
run: ./tools/format.sh --dry

- name: format_check
working-directory: ./
run: ./tools/format.sh --dry
- name: Build native libraries
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=ON -DBUILD_MOD_PK3=OFF -DBUILD_MOD_QVMS=OFF -DBUILD_TESTS=OFF
cmake --build build

- name: cpp_check
working-directory: ./
run: make cppcheck
- name: Build qvm
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=OFF -DBUILD_MOD_PK3=ON -DBUILD_MOD_QVMS=ON -DBUILD_TESTS=OFF
cmake --build build

- name: unit_tests
working-directory: ./
run: make tests
- name: Run tests
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=OFF -DBUILD_MOD_PK3=OFF -DBUILD_MOD_QVMS=OFF -DBUILD_TESTS=ON
cmake --build build

- name: release
working-directory: ./
run: make
- uses: actions/upload-artifact@v4
with:
name: osp2_pk3
path: build/Release/osp/*.pk3
if-no-files-found: error
retention-days: 5

- uses: actions/upload-artifact@v4
with:
name: osp2_linux
path: osp2_linux.tar.gz
if-no-files-found: error
retention-days: 5
- uses: actions/upload-artifact@v4
with:
name: osp2_linux
path: build/Release/osp/*.so
if-no-files-found: error
retention-days: 5

mingw:
name: MinGW GCC
needs: linux
windows-msvc:
name: Windows MSVC

runs-on: windows-2022

Expand All @@ -66,26 +75,71 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build native libraries
run: |
cmake -S . -B build -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=ON -DBUILD_MOD_PK3=OFF -DBUILD_MOD_QVMS=OFF -DBUILD_TESTS=OFF
cmake --build build --config Release

- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build qvm
run: |
cmake -S . -B build -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=OFF -DBUILD_MOD_PK3=ON -DBUILD_MOD_QVMS=ON -DBUILD_TESTS=OFF
cmake --build build --config Release

- name: release
working-directory: ./
run: |
make
- name: Run tests
run: |
cmake -S . -B build -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=OFF -DBUILD_MOD_PK3=OFF -DBUILD_MOD_QVMS=OFF -DBUILD_TESTS=ON
cmake --build build --config Release

- uses: actions/upload-artifact@v4
with:
name: osp2_windows
path: osp2_windows.zip
if-no-files-found: error
retention-days: 5
- uses: actions/upload-artifact@v4
with:
name: osp2_windows_msvc
path: build/Release/osp/*.dll
if-no-files-found: error
retention-days: 5

windows-mingw:
name: Windows MinGW

runs-on: windows-2022

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build native libraries
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=ON -DBUILD_MOD_PK3=OFF -DBUILD_MOD_QVMS=OFF -DBUILD_TESTS=OFF
cmake --build build --config Release

- name: Build qvm
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=OFF -DBUILD_MOD_PK3=ON -DBUILD_MOD_QVMS=ON -DBUILD_TESTS=OFF
cmake --build build --config Release

- name: Run tests
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_MOD_LIBRARIES=OFF -DBUILD_MOD_PK3=OFF -DBUILD_MOD_QVMS=OFF -DBUILD_TESTS=ON
cmake --build build --config Release

- uses: actions/upload-artifact@v4
with:
name: osp2_windows_mingw
path: build/Release/osp/*.dll
if-no-files-found: error
retention-days: 5

create-latest:
if: github.ref == 'refs/heads/master' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [linux, mingw]
needs: [linux, windows-msvc, windows-mingw]
permissions: write-all
runs-on: ubuntu-latest
steps:
Expand All @@ -100,8 +154,6 @@ jobs:
prerelease: false
title: Latest Build
files: |
osp2_windows
osp2_windows_mingw
osp2_linux



osp2_pk3
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
!build
build/qvm/vm/
build/qvm/zz-osp-pak8.pk3
build/library/build/
build/tests/build/
build
osp/
osp2_linux.tar.gz
osp2_windows.zip
47 changes: 47 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
cmake_minimum_required(VERSION 3.25)

if(POLICY CMP0177)
# Policy CMP0177: install() DESTINATION paths are normalized
# Introduced in CMake 3.31
cmake_policy(SET CMP0177 NEW)
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

include(mod)

project(${MOD_NAME} VERSION ${MOD_VERSION} LANGUAGES C)

option(BUILD_MOD_LIBRARIES "Build OSP2 gamecode as native libraries" ON)
option(BUILD_MOD_QVMS "Build OSP2 gamecode as qvms" ON)
option(BUILD_MOD_PK3 "Make .pk3 with assets and (if enabled) qvms" ON)
option(BUILD_TESTS "Build tests" OFF)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_SHARED_LIBRARY_PREFIX "")

# Release build by default, set externally if you want something else
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# Try to enable LTO by default
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED)

if(IPO_SUPPORTED)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE)
endif()

set(SOURCE_DIR ${CMAKE_SOURCE_DIR}/code)

include(libraries/all)
include(compilers/all)

include(basegame)
include(tests)

include(post_configure)
include(installer)
100 changes: 0 additions & 100 deletions Makefile

This file was deleted.

Loading
Loading