-
-
Notifications
You must be signed in to change notification settings - Fork 214
96 lines (76 loc) · 2.47 KB
/
SDLBuild.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# SDLBuild.yml
name: SDLBuild
env:
PROJECT_DIR: examples_for_PC/CMake_SDL
on:
push:
paths:
- '**.ino'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.c'
- '**SDLBuild.yml'
- '**SDL.cmake'
- '**installSDL2.bat'
pull_request:
workflow_dispatch:
jobs:
LGFX_SDL2:
name: LGFX_SDL2 (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- { os: windows-latest }
- { os: macos-12 }
- { os: ubuntu-latest }
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache SDL2 for Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/cache@v3
id: cache-SLD2-windows
with:
path: contrib
key: ${{ runner.os }}-${{ hashFiles('.github/scripts/installSDL2.bat') }}
- name: Build SDL2 for Windows
if: matrix.os == 'windows-latest' && steps.cache-SLD2-windows.outputs.cache-hit != 'true'
run: |
.github/scripts/installSDL2.bat
- name: Build LGFX_SDL2 for Windows
if: ${{ matrix.os == 'windows-latest' }}
env:
CC: clang
CXX: clang++
SDL2_DIR: D:/a/LovyanGFX/LovyanGFX/contrib/src/SDL2-2.0.22/install
run: |
cp .github/scripts/SDL.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
cd ${{ env.PROJECT_DIR }}
cmake -S . -B build/debug -G "Visual Studio 17 2022" -A x64 -T ClangCL -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build build/debug --config Debug
cmake -S . -B build/release -G "Visual Studio 17 2022" -A x64 -T ClangCL -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build build/release --config Release
- name: Build LGFX_SDL2 for Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt update
sudo apt-get install libsdl2-dev
cp .github/scripts/SDL.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
cd ${{ env.PROJECT_DIR }}
mkdir build
cd build
cmake ..
cmake --build .
- name: Build LGFX_SDL2 for Mac
if: ${{ matrix.os == 'macos-12' }}
run: |
brew install sdl2
cp .github/scripts/SDL.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
cd ${{ env.PROJECT_DIR }}
mkdir build
cd build
cmake ..
cmake --build .