Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a230763
feat: add option for meson, to know if we are running in Ci or not, e…
Totto16 May 14, 2025
08da21a
feat: add Ci compiler checks, so that the Ci never uses a version, th…
Totto16 May 14, 2025
caa3857
fix: refactor web-build.sh to correctly detect the option RUN_IN_CI
Totto16 May 14, 2025
cd084f5
feat: add the flag "--fatal-meson-warnings" to every meson setup command
Totto16 May 14, 2025
2c4074f
fix: use correct flatpak action repo again, after it moving twice
Totto16 May 14, 2025
904c7aa
fix: move option parsing in shell scripts to the beginning, where pos…
Totto16 May 14, 2025
c112b75
fix: refactor compiler settings for CI detection
Totto16 May 14, 2025
0fda4d5
fix: use clang 19 as needed compiler, not clang 20
Totto16 May 14, 2025
dad8d85
fix: fix more CI configs for current compilers
Totto16 May 14, 2025
f44de02
feat: add container revision tags for nintendo CI
Totto16 May 14, 2025
7a4921e
fix: use container images with gcc-14 for nintendo CI
Totto16 May 14, 2025
3049d07
fix: refactor the ci config meson code, to be easier to read
Totto16 May 14, 2025
6382aeb
fix: fix emscripten patch for sdl2_image
Totto16 May 14, 2025
3e55f3d
fix: pin emscripten and emsdk to a release, so that it has to be upda…
Totto16 May 14, 2025
b4376c3
fix: correctly handle msys2 in CI config checks
Totto16 May 14, 2025
48314e2
fix: use clang 20 for android, as the ndk we use, already uses that
Totto16 May 14, 2025
7d928b2
fix: fix the web compiler check in the CI config
Totto16 May 14, 2025
36100cc
fix: fix switch compilation with fatal warnings
Totto16 May 14, 2025
41ca45e
fix: use the macro ASSERT in web_client.cpp
Totto16 May 14, 2025
84ea54b
fix: disable fatal-meson-warnings, where it is too much effort, to fi…
Totto16 May 14, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Build native libraries
run: |
bash ./platforms/build-android.sh ${{ matrix.config.arch }} complete_rebuild release
bash ./platforms/build-android.sh ${{ matrix.config.arch }} complete_rebuild release CI
cp -r ./assets/ platforms/android/app/src/main

- name: Build APK
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,47 @@ jobs:
environment: msvc
shell: pwsh
static: false
fatal_warnings: false # TODO: enable fatal warnings, once cpp-httplib is patched either by ourselves or by the maintainers

- name: Windows MSVC (static)
os: windows
os-version: 2022
environment: msvc
shell: pwsh
static: true
fatal_warnings: false # TODO: enable fatal warnings, once cpp-httplib is patched either by ourselves or by the maintainers

- name: Windows MingGW
os: windows
os-version: 2022
environment: mingw
architecture: x86_64
shell: 'msys2 {0}'
fatal_warnings: true

- name: Windows UCRT
os: windows
os-version: 2022
environment: ucrt
architecture: ucrt-x86_64
shell: 'msys2 {0}'
fatal_warnings: true

- name: Linux (ARM64)
os: ubuntu
os-version: 24.04-arm
use-clang: false
arm: true
shell: bash
fatal_warnings: true

- name: Linux
os: ubuntu
os-version: 24.04
use-clang: false
arm: false
shell: bash
fatal_warnings: true

- name: Linux Clang (libstdc++)
os: ubuntu
Expand All @@ -64,6 +70,7 @@ jobs:
use-clang_stdlib: false
arm: false
shell: bash
fatal_warnings: true

- name: Linux Clang (libc++)
os: ubuntu
Expand All @@ -72,18 +79,21 @@ jobs:
use-clang_stdlib: true
arm: false
shell: bash
fatal_warnings: true

- name: MacOS
os: macos
os-version: 13
arm: false
shell: bash
fatal_warnings: true

- name: MacOS (Arm64)
os: macos
os-version: 14
arm: true
shell: bash
fatal_warnings: true

defaults:
run:
Expand Down Expand Up @@ -199,7 +209,7 @@ jobs:
brew install sdl2 sdl2_ttf sdl2_mixer sdl2_image

- name: Configure
run: meson setup build -Dbuildtype=release -Ddefault_library=${{( matrix.config.os == 'windows' && matrix.config.environment == 'msvc' && matrix.config.static ) && 'static' ||'shared' }} -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }}
run: meson setup build -Dbuildtype=release -Ddefault_library=${{( matrix.config.os == 'windows' && matrix.config.environment == 'msvc' && matrix.config.static ) && 'static' ||'shared' }} -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} -Drun_in_ci=true ${{( matrix.config.fatal_warnings ) && '--fatal-meson-warnings' || '' }}

- name: Build
run: meson compile -C build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: flathub-infra/flatpak-github-actions/flatpak-builder@9386d85446c0f8c6b93dea3774002af2abcac3d5
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: oopetris.flatpak
manifest-path: io.github.openbrickprotocolfoundation.oopetris.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
sudo apt-get update
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* desktop-file-utils -y --no-install-recommends

meson setup build -Dbuildtype=release -Dclang_libcpp=disabled -Dtests=true
meson setup build -Dbuildtype=release -Dclang_libcpp=disabled -Dtests=true -Drun_in_ci=true --fatal-meson-warnings
meson compile -C build git_version.hpp

- uses: cpp-linter/cpp-linter-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/musl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
fetch-depth: '0'

- name: Configure
run: meson setup build -Dbuildtype=release -Ddefault_library=shared -Dclang_libcpp=${{ ( matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) && 'enabled' || 'disabled' }}
run: meson setup build -Dbuildtype=release -Ddefault_library=shared -Dclang_libcpp=${{ ( matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) && 'enabled' || 'disabled' }} -Drun_in_ci=true --fatal-meson-warnings

- name: Build
run: meson compile -C build
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/nintendo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ jobs:
name: Nintendo ${{ matrix.config.name }} CI
runs-on: ubuntu-24.04
container:
image: devkitpro/${{ matrix.config.container }} ## base on debian:buster-slim
image: devkitpro/${{ matrix.config.container }}:${{ matrix.config.revision }} ## based on debian:buster-slim
strategy:
fail-fast: false
matrix:
config:
- name: 3ds
extension: 3dsx
container: devkitarm
revision: "20250102"

- name: switch
extension: nro
container: devkita64
revision: "20241023"

steps:
- uses: actions/checkout@v4
Expand All @@ -43,7 +45,7 @@ jobs:

- name: Configure and Build
run: |
bash ./platforms/build-${{ matrix.config.name }}.sh complete_rebuild release
bash ./platforms/build-${{ matrix.config.name }}.sh complete_rebuild release CI

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* gcovr desktop-file-utils -y --no-install-recommends

- name: Configure
run: meson setup build -Dbuildtype=debug -Db_coverage=true -Dtests=true -Dclang_libcpp=enabled
run: meson setup build -Dbuildtype=debug -Db_coverage=true -Dtests=true -Dclang_libcpp=enabled -Drun_in_ci=true --fatal-meson-warnings

- name: Run tests
run: meson test -C build --verbose
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Build
run: |
ENABLE_TESTING=1 bash ./platforms/build-web.sh
ENABLE_TESTING=1 bash ./platforms/build-web.sh complete_rebuild release CI

# TODO upload page to gh-pages!
- name: Upload artifacts
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ jobs:
run: 7z x "-oC:/Program Files (x86)/NSIS" "${{ github.workspace }}/envar_plugin.zip"

- name: Configure
run: meson setup build -Dbuildtype=release -Ddefault_library=shared -Dbuild_installer=true
run: meson setup build -Dbuildtype=release -Ddefault_library=shared -Dbuild_installer=true -Drun_in_ci=true
# TODO: enable fatal warnings, once cpp-httplib is patched either by ourselves or by the maintainers: --fatal-meson-warnings

- name: Build installer
run: |
Expand Down
2 changes: 2 additions & 0 deletions io.github.openbrickprotocolfoundation.oopetris.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ modules:
- -Dbuild_installer=true
- --libdir=lib
- -Dtests=true
- --fatal-meson-warnings
- -Drun_in_ci=true # note we always want the CI checks in the case we built the flatpak
- --force-fallback-for=fmt # note, the freedesktop sdk has this installed, but it is not copiable into the runtime, so we need to build it ourself, to be able to install it correctly
builddir: true
build-options:
Expand Down
8 changes: 8 additions & 0 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ option(
value: false,
description: 'if you only want to build the libs, enable this',
)


option(
'run_in_ci',
type: 'boolean',
value: false,
description: 'enable this, if it is run in CI',
)
69 changes: 41 additions & 28 deletions platforms/build-3ds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@

set -e

## options: "smart, complete_rebuild"
export COMPILE_TYPE="smart"

export BUILDTYPE="debug"

export RUN_IN_CI="false"

if [ "$#" -eq 0 ]; then
# nothing
echo "Using compile type '$COMPILE_TYPE'"
elif [ "$#" -eq 1 ]; then
COMPILE_TYPE="$1"
elif [ "$#" -eq 2 ]; then
COMPILE_TYPE="$1"
BUILDTYPE="$2"
elif [ "$#" -eq 3 ]; then
COMPILE_TYPE="$1"
BUILDTYPE="$2"

if [ -z "$3" ]; then
RUN_IN_CI="false"
else
RUN_IN_CI="true"
fi
else
echo "Too many arguments given, expected 1, 2 or 3"
exit 1
fi

if [ "$COMPILE_TYPE" == "smart" ]; then
: # noop
elif [ "$COMPILE_TYPE" == "complete_rebuild" ]; then
: # noop
else
echo "Invalid COMPILE_TYPE, expected: 'smart' or 'complete_rebuild'"
exit 1
fi

export DEVKITPRO="/opt/devkitpro"
export ARCH_DEVKIT_FOLDER="$DEVKITPRO/devkitARM"
export COMPILER_BIN="$ARCH_DEVKIT_FOLDER/bin"
Expand Down Expand Up @@ -214,33 +252,6 @@ fi

cd ..

## options: "smart, complete_rebuild"
export COMPILE_TYPE="smart"

export BUILDTYPE="debug"

if [ "$#" -eq 0 ]; then
# nothing
echo "Using compile type '$COMPILE_TYPE'"
elif [ "$#" -eq 1 ]; then
COMPILE_TYPE="$1"
elif [ "$#" -eq 2 ]; then
COMPILE_TYPE="$1"
BUILDTYPE="$2"
else
echo "Too many arguments given, expected 1 or 2"
exit 1
fi

if [ "$COMPILE_TYPE" == "smart" ]; then
: # noop
elif [ "$COMPILE_TYPE" == "complete_rebuild" ]; then
: # noop
else
echo "Invalid COMPILE_TYPE, expected: 'smart' or 'complete_rebuild'"
exit 1
fi

if [ ! -d "$ROMFS" ]; then

mkdir -p "$ROMFS"
Expand All @@ -260,7 +271,9 @@ if [ "$COMPILE_TYPE" == "complete_rebuild" ] || [ ! -e "$BUILD_DIR" ]; then
-Dcurl:unittests=disabled \
-Dcurl:bearer-auth=enabled \
-Dcurl:brotli=enabled \
-Dcurl:libz=enabled
-Dcurl:libz=enabled \
"-Drun_in_ci=$RUN_IN_CI" \
--fatal-meson-warnings

fi

Expand Down
21 changes: 17 additions & 4 deletions platforms/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ export COMPILE_TYPE="smart"

export BUILDTYPE="debug"

export RUN_IN_CI="false"

if [ "$#" -eq 0 ]; then
# nothing
echo "Using all architectures"
elif [ "$#" -eq 1 ] || [ "$#" -eq 2 ] || [ "$#" -eq 3 ]; then
elif [ "$#" -eq 1 ] || [ "$#" -eq 2 ] || [ "$#" -eq 3 ] || [ "$#" -eq 4 ]; then
ARCH=$1

FOUND=""
Expand All @@ -77,10 +79,20 @@ elif [ "$#" -eq 1 ] || [ "$#" -eq 2 ] || [ "$#" -eq 3 ]; then
elif [ "$#" -eq 3 ]; then
COMPILE_TYPE="$2"
BUILDTYPE="$3"
elif [ "$#" -eq 4 ]; then
COMPILE_TYPE="$2"
BUILDTYPE="$3"

if [ -z "$4" ]; then
RUN_IN_CI="false"
else
RUN_IN_CI="true"
fi

fi

else
echo "Too many arguments given, expected 1 ,2 or 3"
echo "Too many arguments given, expected 1, 2, 3 or 4"
exit 1
fi

Expand Down Expand Up @@ -270,7 +282,6 @@ for INDEX in "${ARCH_KEYS_INDEX[@]}"; do
-DBUILD_SHARED_LIBS=OFF \
-DINSTALL_PKGCONFIG_MODULES=ON


cmake --build .

cmake --install .
Expand Down Expand Up @@ -436,7 +447,9 @@ EOF
--cross-file "./platforms/crossbuild-android-$ARM_TARGET_ARCH.ini" \
"-Dbuildtype=$BUILDTYPE" \
-Dsdl2:use_hidapi=enabled \
-Dclang_libcpp=disabled
-Dclang_libcpp=disabled \
"-Drun_in_ci=$RUN_IN_CI" \
--fatal-meson-warnings

fi

Expand Down
Loading
Loading