forked from ihhub/fheroes2
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (74 loc) · 2.51 KB
/
cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CMake
on:
workflow_call:
jobs:
cmake:
strategy:
matrix:
config:
- name: Linux SDL2
os: ubuntu-latest
dependencies: libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev gettext ninja-build
- name: macOS SDL2
os: macos-latest
dependencies: sdl2 sdl2_mixer sdl2_image ninja
- name: macOS SDL2 App Bundle
os: macos-latest
dependencies: sdl2 sdl2_mixer sdl2_image ninja dylibbundler
options: -DMACOS_APP_BUNDLE=ON
name: CMake (${{ matrix.config.name }})
runs-on: ${{ matrix.config.os }}
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Linux)
if: ${{ startsWith( matrix.config.os, 'ubuntu-' ) }}
run: |
sudo apt-get -y update
sudo apt-get -y install ${{ matrix.config.dependencies }}
- name: Install dependencies (macOS)
if: ${{ startsWith( matrix.config.os, 'macos-' ) }}
run: |
brew install ${{ matrix.config.dependencies }}
env:
# Do not update outdated dependencies of installed packages
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: ON
- name: Build
run: |
cmake -B build -G Ninja -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_STRICT_COMPILATION=ON \
-DENABLE_IMAGE=ON -DENABLE_TOOLS=ON ${{ matrix.config.options }}
cmake --build build
- name: Install
run: |
sudo cmake --install build
cmake-windows:
name: CMake (Windows SDL2)
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Prepare vcpkg cache
uses: actions/cache@v3
with:
path: ~/AppData/Local/vcpkg/archives
key: cmake-vcpkg-cache-${{ github.sha }}
restore-keys: |
cmake-vcpkg-cache-
- name: Install dependencies
run: |
vcpkg.exe --triplet x64-windows install sdl2 sdl2-mixer sdl2-image zlib
- name: Build
run: |
cmake.exe -B build -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_STRICT_COMPILATION=ON -DENABLE_IMAGE=ON \
-DENABLE_TOOLS=ON -DCMAKE_TOOLCHAIN_FILE="C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET=x64-windows
cmake.exe --build build --config Debug
- name: Install
run: |
cmake.exe --install build --config Debug