Skip to content

Commit

Permalink
Add xsystem35-sdl2 and system3-sdl2 as submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
kichikuou committed Jun 2, 2024
1 parent eb982bb commit ecd0b96
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 3 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
name: Build
on: push

env:
EM_VERSION: 3.1.61
EM_CACHE_FOLDER: 'emsdk-cache'

jobs:
build:
runs-on: ubuntu-latest
steps:

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

- name: Setup cache
id: cache-system-libraries
uses: actions/cache@v4
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{ runner.os }}

- name: Setup Emscripten toolchain
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

- name: Build Wasm
run: ./build-wasm.sh

- name: Build
- name: Build Shell
run: |
npm install
npm run type
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules/
dist/system3.*
dist/xsystem35.*
dist/shell.js*
dist/archiveworker.js*
dist/fdimage.js*
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "xsystem35-sdl2"]
path = xsystem35-sdl2
url = https://github.com/kichikuou/xsystem35-sdl2.git
[submodule "system3-sdl2"]
path = system3-sdl2
url = https://github.com/kichikuou/system3-sdl2.git
16 changes: 16 additions & 0 deletions build-wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
set -e

if [ ! -f "xsystem35-sdl2/CMakeLists.txt" ] || [ ! -f "system3-sdl2/CMakeLists.txt" ]; then
git submodule update --init --recursive
fi

if [ ! -d "xsystem35-sdl2/out" ]; then
emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_COMPILE_WARNING_AS_ERROR=YES -S xsystem35-sdl2 -B xsystem35-sdl2/out
fi
cmake --build xsystem35-sdl2/out && cp xsystem35-sdl2/out/src/xsystem35.* dist/

if [ ! -d "system3-sdl2/out" ]; then
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=YES -S system3-sdl2 -B system3-sdl2/out
fi
cmake --build system3-sdl2/out && cp system3-sdl2/out/system3.* dist/
1 change: 0 additions & 1 deletion dist/system3.js

This file was deleted.

Binary file removed dist/system3.wasm
Binary file not shown.
1 change: 0 additions & 1 deletion dist/xsystem35.js

This file was deleted.

Binary file removed dist/xsystem35.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions system3-sdl2
Submodule system3-sdl2 added at c25227
1 change: 1 addition & 0 deletions xsystem35-sdl2
Submodule xsystem35-sdl2 added at d3650c

0 comments on commit ecd0b96

Please sign in to comment.