Skip to content

Refactor build system to use CMake #103

Refactor build system to use CMake

Refactor build system to use CMake #103

Workflow file for this run

name: Porytiles PR Build
on:
pull_request:
branches: [ "develop" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
pr-build-linux-amd64-clang-llvm:
name: PR build on linux-amd64 with Clang+LLVM 16
runs-on: ubuntu-latest
steps:
- name: Install Clang+LLVM 16 and other build dependencies
run: |
sudo apt-get update
sudo apt-get install zlib1g-dev
sudo apt-get install libpng-dev
sudo apt-get install cmake
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16 all
clang++-16 --version
clang++-16 -v
- name: Checkout porytiles
uses: actions/checkout@v3
- name: Build the project
run: |
cd Porytiles-1.X.X
export CXX=clang++-16
cmake -B build
cd build
cmake --build .
- name: Run test suite
run: |
./Porytiles-1.X.X/build/test/PorytilesTestSuite
pr-build-linux-amd64-gcc:
name: PR build on linux-amd64 with GCC 13
# As of 14-Jun-2024 need ubuntu-24.04 since GitHub removed GCC13 from ubuntu-latest
# https://github.com/actions/runner-images/issues/9866
# TODO : move to GCC 14?
runs-on: ubuntu-24.04
steps:
- name: Install GCC 13 and dependencies
run: |
sudo apt-get update
sudo apt-get install zlib1g-dev
sudo apt-get install libpng-dev
sudo apt-get install cmake
sudo apt-get install g++-13
g++-13 --version
g++-13 -v
- name: Checkout porytiles
uses: actions/checkout@v3
- name: Build the project
run: |
cd Porytiles-1.X.X
export CXX=g++-13
cmake -B build
cd build
cmake --build .
- name: Run test suite
run: |
./Porytiles-1.X.X/build/test/PorytilesTestSuite
pr-build-macos-aarch4-clang-llvm:
name: PR build on macos-aarch64 with Clang+LLVM 16
runs-on: macos-latest
# GitHub removed Intel Mac runners, so macos-latest is now aarch64
# We don't need to install zlib since it is shipped with MacOS, CMake will find it
steps:
- name: Install Clang+LLVM 16 and dependencies
run: |
brew update
brew install libpng || true
brew install cmake || true
brew install llvm@16 || true
/opt/homebrew/opt/llvm@16/bin/clang++ --version
/opt/homebrew/opt/llvm@16/bin/clang++ -v
brew info libpng
- name: Checkout porytiles
uses: actions/checkout@v3
- name: Build the project
run: |
brew info libpng
otool -L /opt/homebrew/lib/libpng.dylib
ls -la /opt/homebrew/lib/libpng.dylib
cd Porytiles-1.X.X
export CXX=/opt/homebrew/opt/llvm@16/bin/clang++
cmake -B build
cd build
cmake --build .
- name: Run test suite
run: |
./Porytiles-1.X.X/build/test/PorytilesTestSuite