Skip to content

Commit

Permalink
CMake: Add build presets and use them for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
carstene1ns committed Oct 27, 2023
1 parent 5f8ecf2 commit 58c67fb
Show file tree
Hide file tree
Showing 3 changed files with 371 additions and 17 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
- name: Prepare Environment
run: |
echo "SHORT_SHA=${GITHUB_SHA:0:10}" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -95,19 +94,17 @@ jobs:
- name: Prepare Environment
run: |
echo "SHORT_SHA=${GITHUB_SHA:0:10}" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4

- name: Build OpenJazz
run: |
cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --workflow --preset release
- name: Prepare artifact
run: |
cmake --install build --prefix $PWD
cmake --install build-release --prefix $PWD
cp /mingw64/bin/SDL2.dll dist/
asciidoctor -o OpenJazzManual.html -a oj_version=${SHORT_SHA} res/unix/OpenJazz.6.adoc
w3m -dump -cols 2147483647 -s OpenJazzManual.html > dist/Manual.txt
Expand Down Expand Up @@ -136,15 +133,13 @@ jobs:
- name: Prepare Environment
run: |
echo "SHORT_SHA=${GITHUB_SHA:0:10}" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4

- name: Build OpenJazz
run: |
export CXXFLAGS="-Wall -g -O2"
$DEVKITPRO/portlibs/wii/bin/powerpc-eabi-cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=Release
$DEVKITPRO/portlibs/wii/bin/powerpc-eabi-cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
- name: Prepare artifact
Expand Down Expand Up @@ -177,15 +172,13 @@ jobs:
- name: Prepare Environment
run: |
echo "SHORT_SHA=${GITHUB_SHA:0:10}" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4

- name: Build OpenJazz
run: |
export CXXFLAGS="-Wall -g -O2"
$DEVKITPRO/portlibs/3ds/bin/arm-none-eabi-cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=Release
$DEVKITPRO/portlibs/3ds/bin/arm-none-eabi-cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
- name: Prepare artifact
Expand Down Expand Up @@ -218,7 +211,6 @@ jobs:
- name: Prepare Environment
run: |
echo "SHORT_SHA=${GITHUB_SHA:0:10}" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Prepare GCCSDK autobuilder and build SDL
run: |
Expand Down Expand Up @@ -263,20 +255,18 @@ jobs:
- name: Prepare Environment
run: |
echo "SHORT_SHA=${GITHUB_SHA:0:10}" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4

- name: Build OpenJazz
run: |
export CXXFLAGS="-Wall -g -O2"
psp-cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=Release -DNETWORK=OFF
cmake --build build
cmake --preset=psp-release -DNETWORK=OFF
cmake --build --preset=psp-release
- name: Prepare artifact
run: |
cmake --install build --prefix $PWD
cmake --install build-psp-release --prefix $PWD
asciidoctor -o OpenJazzManual.html -a oj_version=${SHORT_SHA} res/unix/OpenJazz.6.adoc
w3m -dump -cols 2147483647 -s OpenJazzManual.html > OpenJazz/Manual.txt
cp README.md OpenJazz/README.txt
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CMakeFiles/
!/builds/cmake/*.cmake
ext/Makefile
build.ninja
CMakeUserPresets.json

# homebrew
*.elf
Expand Down
Loading

0 comments on commit 58c67fb

Please sign in to comment.