Skip to content

Commit afbcb10

Browse files
authored
Merge pull request #147 from OpenBrickProtocolFoundation/146-update-to-gcc-14
CI: Update to GCC 14
2 parents 0464843 + 49c32e4 commit afbcb10

File tree

14 files changed

+165
-95
lines changed

14 files changed

+165
-95
lines changed

.github/workflows/android.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
android-build:
1313
name: Build android apk for - ${{ matrix.config.arch }}
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
strategy:
1616
fail-fast: false
1717
matrix:
@@ -25,14 +25,15 @@ jobs:
2525
with:
2626
fetch-depth: "0"
2727

28+
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
2829
- name: Setup Meson
2930
run: |
30-
python -m pip install --upgrade pip
31-
pip install meson
31+
pip install meson --break-system-packages
3232
3333
- name: Setup ninja
3434
run: |
3535
sudo apt-get update
36+
sudo apt-get upgrade -y
3637
sudo apt-get install ninja-build jq
3738
3839
- name: Setup JDK

.github/workflows/cpp-linter.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ on:
77

88
jobs:
99
cpp-linter:
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-24.04
1111
permissions:
1212
pull-requests: write
1313
issues: write
1414
steps:
1515
- uses: actions/checkout@v4
1616

17+
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
1718
- name: Setup Meson
1819
run: |
19-
python -m pip install --upgrade pip
20-
pip install meson
20+
pip install meson --break-system-packages
2121
2222
- name: Setup Clang
2323
uses: egor-tensin/setup-clang@v1
@@ -28,7 +28,9 @@ jobs:
2828
- name: Prepare compile_commands.json
2929
run: |
3030
sudo apt-get update
31+
sudo apt-get upgrade -y
3132
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* -y
33+
3234
meson setup build -Dbuildtype=release -Dclang_libcpp=disabled -Dtests=true
3335
meson compile -C build git_version.hpp
3436

.github/workflows/flatpak.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
flatpak:
1313
name: "Flatpak build"
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
container:
1616
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
1717
options: --privileged

.github/workflows/installer.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
- name: Setup meson
4242
if: matrix.config.os != 'macos'
4343
run: |
44-
python -m pip install --upgrade pip
4544
pip install meson
4645
4746
- name: Configure

.github/workflows/meson.yml

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,45 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
# Customize the Meson build type here ("plain", "debug", "debugoptimized", "release", "minsize", "custom".)
1817
config:
1918
- name: Windows MSVC Release
2019
os: windows
2120
os-version: 2022
22-
msvc: true
21+
environment: msvc
2322
buildtype: release
2423
library_type: static
2524
shell: pwsh
2625

2726
- name: Windows MingGW Release
2827
os: windows
2928
os-version: 2022
30-
msvc: false
29+
environment: mingw
30+
architecture: x86_64
3131
buildtype: release
3232
library_type: static
3333
shell: "msys2 {0}"
3434

35+
- name: Windows UCRT Release
36+
os: windows
37+
os-version: 2022
38+
environment: ucrt
39+
architecture: ucrt-x86_64
40+
buildtype: release
41+
library_type: static
42+
shell: "msys2 {0}"
43+
44+
3545
- name: Linux Release
3646
os: ubuntu
37-
os-version: 22.04
47+
os-version: 24.04
3848
buildtype: release
3949
use-clang: false
4050
library_type: shared
4151
shell: bash
4252

4353
- name: Linux Clang Release (libstdc++)
4454
os: ubuntu
45-
os-version: 22.04
55+
os-version: 24.04
4656
buildtype: release
4757
use-clang: true
4858
use-clang_stdlib: false
@@ -51,7 +61,7 @@ jobs:
5161

5262
- name: Linux Clang Release (libc++)
5363
os: ubuntu
54-
os-version: 22.04
64+
os-version: 24.04
5565
buildtype: release
5666
use-clang: true
5767
use-clang_stdlib: true
@@ -84,21 +94,32 @@ jobs:
8494
fetch-depth: "0"
8595

8696
- name: Setup MSVC (Windows)
87-
if: matrix.config.os == 'windows' && matrix.config.msvc == true
97+
if: matrix.config.os == 'windows' && matrix.config.environment == 'msvc'
8898
uses: TheMrMilchmann/setup-msvc-dev@v3
8999
with:
90100
arch: x64
91101
toolset: 14.39
92102

93103

94-
- name: Setup MinGW (Windows)
95-
if: matrix.config.os == 'windows' && matrix.config.msvc == false
104+
- name: Setup MYSYS2 (Windows)
105+
if: matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' )
96106
uses: msys2/setup-msys2@v2
97107
with:
98-
msystem: MINGW64
108+
msystem: ${{matrix.config.environment == 'mingw' && 'MINGW64' || 'UCRT64'}}
99109
update: true
100-
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja mingw-w64-x86_64-python mingw-w64-x86_64-python-pip mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-pkg-config mingw-w64-x86_64-ca-certificates mingw-w64-x86_64-cmake git
101-
110+
install: >-
111+
mingw-w64-${{matrix.config.architecture}}-gcc
112+
mingw-w64-${{matrix.config.architecture}}-ninja
113+
mingw-w64-${{matrix.config.architecture}}-python
114+
mingw-w64-${{matrix.config.architecture}}-python-pip
115+
mingw-w64-${{matrix.config.architecture}}-SDL2
116+
mingw-w64-${{matrix.config.architecture}}-SDL2_ttf
117+
mingw-w64-${{matrix.config.architecture}}-SDL2_mixer
118+
mingw-w64-${{matrix.config.architecture}}-SDL2_image
119+
mingw-w64-${{matrix.config.architecture}}-pkg-config
120+
mingw-w64-${{matrix.config.architecture}}-ca-certificates
121+
mingw-w64-${{matrix.config.architecture}}-cmake
122+
git
102123
103124
- name: Setup Clang (Linux)
104125
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true
@@ -116,7 +137,7 @@ jobs:
116137
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == false
117138
uses: egor-tensin/setup-gcc@v1
118139
with:
119-
version: 13
140+
version: 14
120141
platform: x64
121142

122143
- name: Setup Clang (MacOS)
@@ -140,16 +161,17 @@ jobs:
140161
brew update
141162
brew install meson
142163
164+
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
143165
- name: Setup meson
144166
if: matrix.config.os != 'macos'
145167
run: |
146-
python -m pip install --upgrade pip
147-
pip install meson
168+
pip install meson --break-system-packages
148169
149170
- name: Install dependencies (Linux)
150171
if: matrix.config.os == 'ubuntu'
151172
run: |
152173
sudo apt-get update
174+
sudo apt-get upgrade -y
153175
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* -y
154176
155177
- name: Install dependencies (MacOS)

.github/workflows/nintendo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111
name: Nintendo ${{ matrix.config.name }} CI
12-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1313
container:
1414
image: devkitpro/${{ matrix.config.container }} ## base on debian:buster-slim
1515
strategy:

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111
name: Run Tests
12-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
@@ -24,16 +24,16 @@ jobs:
2424
echo "CC=clang-18" >> "$GITHUB_ENV"
2525
echo "CXX=clang++-18" >> "$GITHUB_ENV"
2626
27+
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
2728
- name: Setup meson
2829
run: |
29-
python -m pip install --upgrade pip
30-
pip install meson
30+
pip install meson --break-system-packages
3131
3232
- name: Install dependencies
3333
run: |
3434
sudo apt-get update
35-
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* -y
36-
pip install gcovr
35+
sudo apt-get upgrade -y
36+
sudo apt-get install ninja-build libsdl2-2.0-0 libsdl2-dev libsdl2-ttf* libsdl2-mixer* libsdl2-image* gcovr -y
3737
3838
- name: Configure
3939
run: meson setup build -Dbuildtype=debug -Db_coverage=true -Dtests=true -Dclang_libcpp=enabled

platforms/build-android.sh

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ for INDEX in "${ARCH_KEYS_INDEX[@]}"; do
105105
ARM_COMPILER_TRIPLE=$(echo "$RAW_JSON" | jq -M -r -c '."llvm_triple"')
106106
ARM_TOOL_TRIPLE=$(echo "$ARM_NAME_TRIPLE$SDK_VERSION" | sed s/$ARCH/$ARCH_VERSION/)
107107

108-
export SYM_LINK_PATH=sysroot_sym-$ARCH_VERSION
108+
export SYM_LINK_PATH=sym-$ARCH_VERSION
109109

110110
export HOST_ROOT="$BASE_PATH/toolchains/llvm/prebuilt/linux-x86_64"
111-
export SYS_ROOT="${HOST_ROOT}/$SYM_LINK_PATH"
111+
export SYS_ROOT="${HOST_ROOT}/$SYM_LINK_PATH/sysroot"
112112
export BIN_DIR="$HOST_ROOT/bin"
113113
export PATH="$BIN_DIR:$PATH"
114114

@@ -177,47 +177,41 @@ for INDEX in "${ARCH_KEYS_INDEX[@]}"; do
177177

178178
cd "$BUILD_DIR_MPG123"
179179

180-
wget -q "https://www.mpg123.de/download/mpg123-1.32.6.tar.bz2"
180+
if [ ! -e "mpg123-1.32.6.tar.bz2" ]; then
181+
wget -q "https://www.mpg123.de/download/mpg123-1.32.6.tar.bz2"
182+
fi
181183

182-
tar -xf "mpg123-1.32.6.tar.bz2"
184+
if [ ! -d "mpg123-1.32.6" ]; then
185+
tar -xf "mpg123-1.32.6.tar.bz2"
186+
fi
183187

184188
cd "mpg123-1.32.6"
185189

186-
BUILDYSTEM="cmake"
187-
188-
if [ $BUILDYSTEM = "autotools" ]; then
189-
190-
./configure --prefix="$SYS_ROOT/usr" --oldincludedir="$SYS_ROOT/usr/include" --host="$ARM_NAME_TRIPLE" --with-sysroot="$SYS_ROOT" --with-audio="dummy"
191-
192-
make
193-
194-
make install
190+
cd ports/cmake/
195191

196-
else
197-
198-
cd ports/cmake/
199-
200-
BUILD_DIR_MPG123="build-mpg123"
192+
BUILD_DIR_MPG123="build-mpg123"
201193

202-
mkdir -p "$BUILD_DIR_MPG123"
194+
mkdir -p "$BUILD_DIR_MPG123"
203195

204-
cd "$BUILD_DIR_MPG123"
196+
cd "$BUILD_DIR_MPG123"
205197

206-
if [ "$ARCH_VERSION" = "i686" ]; then
207-
#cmake .. -DCMAKE_TOOLCHAIN_FILE=linux_i686.toolchain.cmake --install-prefix "$SYS_ROOT/usr" "-DCMAKE_SYSROOT=$SYS_ROOT" -DOUTPUT_MODULES=dummy -DCMAKE_POSITION_INDEPENDENT_CODE=ON
208-
# cmake --build .
198+
export MPG123_ANDROID_SSE_ENABLED="ON"
209199

210-
# cmake --install .
211-
: # nop, for bash syntax
200+
if [ "$ARCH_VERSION" = "i686" ]; then
201+
MPG123_ANDROID_SSE_ENABLED="OFF"
202+
fi
212203

213-
else
214-
cmake .. --install-prefix "$SYS_ROOT/usr" "-DCMAKE_SYSROOT=$SYS_ROOT" -DOUTPUT_MODULES=dummy -DCMAKE_POSITION_INDEPENDENT_CODE=ON
215-
cmake --build .
204+
cmake .. --install-prefix "$SYS_ROOT/usr" "-DCMAKE_SYSROOT=$SYS_ROOT" -DOUTPUT_MODULES=dummy -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
205+
"-DCMAKE_SYSTEM_NAME=Android" \
206+
"-DCMAKE_SYSTEM_VERSION=$SDK_VERSION" \
207+
"-DCMAKE_ANDROID_ARCH_ABI=$KEY" \
208+
"-DCMAKE_ANDROID_NDK=$ANDROID_NDK" \
209+
"-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" \
210+
"-DWITH_SSE=$MPG123_ANDROID_SSE_ENABLED"
216211

217-
cmake --install .
218-
fi
212+
cmake --build .
219213

220-
fi
214+
cmake --install .
221215

222216
touch "$BUILD_MPG123_FILE"
223217

@@ -241,17 +235,39 @@ for INDEX in "${ARCH_KEYS_INDEX[@]}"; do
241235

242236
cd "$BUILD_DIR_OPENSSL"
243237

244-
wget -q "https://github.com/openssl/openssl/releases/download/openssl-3.3.0/openssl-3.3.0.tar.gz"
238+
if [ ! -e "openssl-3.3.0.tar.gz" ]; then
239+
wget -q "https://github.com/openssl/openssl/releases/download/openssl-3.3.0/openssl-3.3.0.tar.gz"
240+
fi
245241

246-
tar -xzf "openssl-3.3.0.tar.gz"
242+
if [ ! -d "openssl-3.3.0" ]; then
243+
tar -xzf "openssl-3.3.0.tar.gz"
244+
fi
247245

248246
cd "openssl-3.3.0"
249247

250248
OPENSSL_TARGET_ARCH="android-$ARCH"
251249

252250
export ANDROID_NDK_ROOT="$ANDROID_NDK_HOME"
253251

254-
./Configure --prefix="$SYS_ROOT/usr" no-tests no-shared "$OPENSSL_TARGET_ARCH" "-D__ANDROID_API__=$SDK_VERSION"
252+
if [ "$ARCH_VERSION" = "armv7a" ]; then
253+
254+
./Configure --prefix="$SYS_ROOT/usr" no-asm no-tests no-shared "$OPENSSL_TARGET_ARCH" "-D__ANDROID_API__=$SDK_VERSION"
255+
else
256+
./Configure --prefix="$SYS_ROOT/usr" no-tests no-shared "$OPENSSL_TARGET_ARCH" "-D__ANDROID_API__=$SDK_VERSION"
257+
fi
258+
259+
make clean
260+
261+
if [ "$ARCH_VERSION" = "armv7-a" ]; then
262+
263+
# fix an compile time error since openssl 3.1.0 >
264+
# see https://github.com/android/ndk/issues/1992
265+
# Apply patch that fixes the armcap instruction
266+
267+
# sed -e '/[.]hidden.*OPENSSL_armcap_P/d; /[.]extern.*OPENSSL_armcap_P/ {p; s/extern/hidden/ }' -i -- crypto/*arm*pl crypto/*/asm/*arm*pl
268+
sed -E -i '' -e '/[.]hidden.*OPENSSL_armcap_P/d' -e '/[.]extern.*OPENSSL_armcap_P/ {p; s/extern/hidden/; }' crypto/*arm*pl crypto/*/asm/*arm*pl
269+
270+
fi
255271

256272
make -j build_sw
257273

src/game/tetrion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Tetrion::Tetrion(
2323
bool is_top_level
2424
)
2525
: ui::Widget{ layout , ui::WidgetType::Component ,is_top_level},
26-
m_next_gravity_simulation_step_index{ get_gravity_delay_frames() },
2726
m_lock_delay_step_index{ lock_delay },
2827
m_service_provider{ service_provider },
2928
m_recording_writer{ std::move(recording_writer) },
3029
m_random{ random_seed },
3130
m_level{ starting_level },
3231
m_tetrion_index{ tetrion_index },
32+
m_next_gravity_simulation_step_index{ get_gravity_delay_frames() },
3333
main_layout{
3434
utils::size_t_identity<2>(),
3535
0,
@@ -494,7 +494,7 @@ void Tetrion::refresh_previews() {
494494
auto bag_index = usize{ 0 };
495495
for (std::remove_cvref_t<decltype(num_preview_tetrominos)> i = 0; i < num_preview_tetrominos; ++i) {
496496
m_preview_tetrominos.at(static_cast<usize>(i)) = Tetromino{
497-
grid::preview_tetromino_position + shapes::UPoint{0, static_cast<u32>(grid::preview_padding * i)},
497+
grid::preview_tetromino_position + shapes::UPoint{ 0, static_cast<u32>(grid::preview_padding * i) },
498498
m_sequence_bags.at(bag_index)[sequence_index]
499499
};
500500
++sequence_index;

0 commit comments

Comments
 (0)