Skip to content

Commit b5f718e

Browse files
authored
Feature/build fix (#71)
* fixing the build * to check if only mac-os build fails * this should fix build_tests.py on mac-os * no-strict-prototypes * adding rgbds-live * gbstudio build also * do not reapeat use matrix
1 parent 6ce5946 commit b5f718e

2 files changed

Lines changed: 44 additions & 29 deletions

File tree

.github/workflows/build.yml

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,25 @@ on:
88
- main
99
pull_request:
1010

11+
env:
12+
EM_VERSION: 4.0.8
13+
EM_CACHE_FOLDER: 'emsdk-cache'
14+
1115
jobs:
1216
build:
1317
name: build
1418
runs-on: ${{ matrix.os }}
1519
strategy:
20+
fail-fast: false
1621
matrix:
1722
os: [ubuntu-latest, macos-latest, windows-latest]
1823
steps:
19-
- uses: actions/setup-python@v1
24+
- uses: actions/setup-python@v5
2025
with:
2126
python-version: '3.x'
22-
- uses: actions/checkout@v1
27+
- uses: actions/checkout@v4
2328
with:
2429
submodules: true
25-
2630
- name: install packages (linux)
2731
run: |
2832
sudo apt-get update
@@ -38,7 +42,7 @@ jobs:
3842
if: matrix.os == 'windows-latest'
3943

4044
- name: download sdl2 (windows)
41-
uses: albin-johansson/download-sdl2@v1
45+
uses: albin-johansson/download-sdl2@v2
4246
with:
4347
version: 2.0.14
4448
sources_destination: .
@@ -65,35 +69,46 @@ jobs:
6569
python scripts/tester.py -vv --exe bin/binjgb-tester
6670
if: matrix.os != 'windows-latest'
6771

68-
build-wasm:
69-
name: build-wasm
72+
build-wasm-variants:
73+
name: build-${{ matrix.target }}
7074
runs-on: ubuntu-latest
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
target: [wasm, rgbds-live, gbstudio]
79+
include:
80+
- target: wasm
81+
cmake_flags: ""
82+
- target: rgbds-live
83+
cmake_flags: '-DWERROR=ON -DRGBDS_LIVE=ON -DCMAKE_C_FLAGS="-DBREAKPOINTS_MAX_BANKS_NUMBER=256"'
84+
- target: gbstudio
85+
cmake_flags: "-DWERROR=ON -DGBSTUDIO=ON"
86+
7187
steps:
72-
- uses: actions/checkout@v1
73-
with:
74-
submodules: true
88+
- uses: actions/checkout@v4
89+
with:
90+
submodules: true
7591

76-
- name: install packages
77-
run: sudo apt-get install ninja-build
92+
- name: install packages
93+
run: sudo apt-get install ninja-build
7894

79-
- name: emsdk install
80-
run: |
81-
mkdir $HOME/emsdk
82-
git clone --depth 1 https://github.com/emscripten-core/emsdk.git $HOME/emsdk
83-
$HOME/emsdk/emsdk update-tags
84-
$HOME/emsdk/emsdk install tot
85-
$HOME/emsdk/emsdk activate tot
95+
- name: setup cache
96+
uses: actions/cache@v4
97+
with:
98+
path: ${{ env.EM_CACHE_FOLDER }}
99+
key: ${{ env.EM_VERSION }}-${{ runner.os }}
86100

87-
- name: update path
88-
run: echo "PATH=$PATH:$HOME/emsdk" >> $GITHUB_ENV
101+
- name: emsdk install
102+
uses: mymindstorm/setup-emsdk@v14
103+
with:
104+
version: ${{ env.EM_VERSION }}
105+
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
89106

90-
- name: mkdir
91-
run: mkdir -p out
107+
- name: mkdir
108+
run: mkdir -p out
92109

93-
- name: cmake
94-
run: cmake -S . -B out -G Ninja -DCMAKE_TOOLCHAIN_FILE=$HOME/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Release -DWASM=true
110+
- name: cmake
111+
run: emcmake cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DWASM=true ${{ matrix.cmake_flags }}
95112

96-
- name: build
97-
run: |
98-
source $HOME/emsdk/emsdk_env.sh
99-
cmake --build out
113+
- name: build
114+
run: emmake cmake --build out

scripts/build_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def BuildWlaGb():
5656
Run('cmake', '-G', 'NMake Makefiles', '-DCMAKE_BUILD_TYPE=Release', WLA_DX_DIR, cwd=WLA_DX_BUILD_DIR)
5757
Run('nmake', cwd=WLA_DX_BUILD_DIR)
5858
else:
59-
Run('cmake', WLA_DX_DIR, cwd=WLA_DX_BUILD_DIR)
59+
Run('cmake', '-DCMAKE_POLICY_VERSION_MINIMUM=3.5', '-DCMAKE_C_FLAGS=-Wno-strict-prototypes', WLA_DX_DIR, cwd=WLA_DX_BUILD_DIR)
6060
Run('make', cwd=WLA_DX_BUILD_DIR)
6161
# Test that wla-gb was build OK.
6262
Run(os.path.join(WLA_DX_BIN_DIR, 'wla-gb'))

0 commit comments

Comments
 (0)