Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: build

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
name: ${{ matrix.platform }} (${{ matrix.toolchain }}) ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# Full cross-product: every platform in both configurations. The include
# entries key off `os`, an existing matrix value, so they merge into the
# matching combinations rather than creating extra jobs.
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [Debug, Release]
include:
- os: ubuntu-latest
platform: Linux
toolchain: GCC
- os: windows-latest
platform: Windows
toolchain: MSVC
- os: macos-latest
platform: macOS
toolchain: Clang

steps:
- name: Checkout
uses: actions/checkout@v5

# The bundled SDL3 is built from source, so its Linux backends need the
# usual X11/Wayland/audio/GL development headers.
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev \
libxfixes-dev libxss-dev libxkbcommon-dev libxtst-dev \
libwayland-dev wayland-protocols libwayland-egl-backend-dev \
libegl1-mesa-dev libgles2-mesa-dev libgl1-mesa-dev \
libasound2-dev libpulse-dev libpipewire-0.3-dev \
libdbus-1-dev libudev-dev

- name: Configure
run: >
cmake -S . -B build
-DBSTONE_SDL_BUNDLED=ON
-DBSTONE_TESTS=ON
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

# No --target, so this builds every target: the game, the tools, the
# bundled libraries and the test suite.
- name: Build all targets
run: cmake --build build --config ${{ matrix.build_type }} --parallel

# Run in both configurations on purpose. A Release build defines NDEBUG,
# which compiles BSTONE_ASSERT away, so the Debug run is what exercises
# the assertion-guarded failure paths.
- name: Run tests
shell: bash
run: |
set -euo pipefail
bin=$(find build -type f \( -name bstone_tests -o -name bstone_tests.exe \) | head -1)
if [ -z "$bin" ]; then
echo "::error::bstone_tests binary not found"
find build -name 'bstone_tests*' || true
exit 1
fi
echo "Running $bin"
"$bin"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
build/
build-*/
data/
.vscode/
.vs/
.DS_Store
test.data
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1151,14 +1151,11 @@ Add option `--cheats` to enable these keys.
* [Nuked OPL3](http://github.com/nukeykt/Nuked-OPL3)
See file `src/lib/nuked_opl3/LICENSE` for license information

* [FLAC](https://xiph.org/flac/)
See file `src/lib/flac/COPYING.Xiph` for license information
* [dr_flac](https://github.com/mackron/dr_libs)
FLAC decoder. See the license statement at the end of file `src/lib/dr_flac/dr_flac.h` (public domain or MIT-0).

* [Ogg](https://www.xiph.org/ogg/)
See file `src/lib/ogg/COPYING` for license information

* [Vorbis](https://www.xiph.org/vorbis/)
See file `src/lib/vorbis/COPYING` for license information
* [stb_vorbis](https://github.com/nothings/stb)
Ogg Vorbis decoder. See the license statement at the end of file `src/lib/stb_vorbis/stb_vorbis.c` (public domain or MIT).


17 - Credits
Expand Down
15 changes: 10 additions & 5 deletions src/bstone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,11 @@ target_link_libraries(bstone
${CMAKE_DL_LIBS}
bstone::lib::sdl
Threads::Threads
bstone::lib::flac
bstone::lib::dr_flac
bstone::lib::khronos
bstone::lib::nuked_opl3
bstone::lib::ogg
bstone::lib::openal_soft
bstone::lib::vorbis
bstone::lib::vorbisfile
bstone::lib::stb_vorbis
bstone::lib::xbrz
bstone::lib::zlib
bstone::lib::vulkan
Expand Down Expand Up @@ -956,10 +954,17 @@ source_group("bstone" FILES ${BSTONE_BSTONE_SOURCES})
if (WIN32)
set(BSTONE_RESOURCES_WIN32_SOURCES
src/resources/win32/bstone_win32_rc.h
$<$<CXX_COMPILER_ID:MSVC>:src/resources/win32/bstone_win32_msvc.manifest>
"${PROJECT_BINARY_DIR}/src/resources/win32/bstone_win32.rc"
)

# The manifest is MSVC-only. Use a plain if(MSVC) rather than a
# $<CXX_COMPILER_ID:MSVC> genex in the source list: the Visual Studio generator
# rejects it ("$<CXX_COMPILER_ID> may only be used with binary targets").
if (MSVC)
list(APPEND BSTONE_RESOURCES_WIN32_SOURCES
src/resources/win32/bstone_win32_msvc.manifest)
endif ()

target_sources(bstone PRIVATE ${BSTONE_RESOURCES_WIN32_SOURCES})
source_group("resources/win32" FILES ${BSTONE_RESOURCES_WIN32_SOURCES})
endif ()
Expand Down
1 change: 1 addition & 0 deletions src/bstone/src/3d_draw2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later


#include "3d_def.h"
#include <algorithm>
#include "d3_d2.h"
#include "id_vl.h"

Expand Down
Loading