@@ -4,21 +4,43 @@ on: push
4
4
5
5
env :
6
6
BUILD_TYPE : Release
7
- EM_VERSION : 3.1.35
8
- EM_CACHE_FOLDER : ' emsdk-cache'
9
7
10
8
jobs :
11
9
build :
12
10
strategy :
13
11
fail-fast : false
14
12
matrix :
15
13
platform :
16
- - { name: Ubuntu GCC, os: ubuntu-latest, compiler: g++, arch: "64", cmakepp: "", suffix: "", flags: "-DCMAKE_CXX_COMPILER=g++"}
17
- - { name: Ubuntu Clang, os: ubuntu-latest, compiler: clang++, arch: "64", cmakepp: "", suffix: "", flags: "-DCMAKE_CXX_COMPILER=clang++"}
18
- - { name: Windows 32, os: windows-latest, compiler: vs2019, arch: "32", cmakepp: "", suffix: "", flags: "-DCMAKE_PREFIX_PATH=`pwd`/../dependencies -A Win32"}
19
- - { name: Windows 64, os: windows-latest, compiler: vs2019, arch: "64", cmakepp: "", suffix: "", flags: "-DCMAKE_PREFIX_PATH=`pwd`/../dependencies -A x64"}
20
- - { name: MacOS, os: macos-latest, compiler: clang++, arch: "64", cmakepp: "", suffix: "", flags: "-DCMAKE_PREFIX_PATH=/opt/homebrew/opt/sfml@2"}
21
- - { name: WebAssembly, os: ubuntu-latest, compiler: em++, arch: "32", cmakepp: "emcmake", suffix: "-emscripten", flags: "-DCMAKE_PREFIX_PATH=`pwd`/../dependencies -DCMAKE_FIND_ROOT_PATH=/ -DLXGUI_TEST_IMPLEMENTATION=OPENGL_SDL"}
14
+ - name : Ubuntu GCC
15
+ os : ubuntu-latest
16
+ compiler : g++
17
+ arch : " 64"
18
+ suffix : " "
19
+ cmake-flags : " "
20
+ - name : Ubuntu Clang
21
+ os : ubuntu-latest
22
+ compiler : clang++
23
+ arch : " 64"
24
+ suffix : " "
25
+ cmake-flags : " "
26
+ - name : Windows
27
+ os : windows-latest
28
+ compiler : msvc
29
+ arch : " 64"
30
+ suffix : " "
31
+ cmake-flags : " "
32
+ - name : MacOS
33
+ os : macos-latest
34
+ compiler : clang++
35
+ arch : " 64"
36
+ suffix : " "
37
+ cmake-flags : " "
38
+ - name : WebAssembly
39
+ os : ubuntu-latest
40
+ compiler : em++
41
+ arch : " 32"
42
+ suffix : " -emscripten"
43
+ cmake-flags : " -DLXGUI_BUILD_GUI_SFML_IMPL=OFF -DLXGUI_BUILD_INPUT_SFML_IMPL=OFF -DLXGUI_TEST_IMPLEMENTATION=OPENGL_SDL"
22
44
23
45
name : ${{matrix.platform.name}}
24
46
runs-on : ${{matrix.platform.os}}
@@ -31,80 +53,94 @@ jobs:
31
53
32
54
- name : Setup Clang
33
55
if : matrix.platform.compiler == 'clang++' && matrix.platform.os == 'ubuntu-latest'
34
- run : sudo apt install clang
56
+ run : |
57
+ sudo apt install clang
58
+ echo "CC=clang" >> $GITHUB_ENV
59
+ echo "CXX=clang++" >> $GITHUB_ENV
35
60
36
- - name : Setup Emscripten cache
37
- if : matrix.platform.compiler == 'em++'
38
- id : cache-system-libraries
61
+ - name : Setup Conan
62
+ shell : bash
63
+ working-directory : ${{github.workspace}}
64
+ run : |
65
+ pip install conan
66
+ echo "CONAN_HOME=`pwd`/conan-cache" >> $GITHUB_ENV
67
+
68
+ - name : Setup Conan cache
69
+ id : cache-conan-packages
39
70
uses : actions/cache@v4
40
71
with :
41
- path : ${{env.EM_CACHE_FOLDER }}
42
- key : ${{env.EM_VERSION}}-${{ matrix.platform.name}}-${{matrix.build-type }}
72
+ path : ${{env.CONAN_HOME }}
73
+ key : ${{matrix.platform.name}}-${{matrix.platform.compiler }}
43
74
44
- - name : Setup Emscripten
45
- if : matrix.platform.compiler == 'em++'
46
- uses : mymindstorm/setup-emsdk@v14
47
- with :
48
- version : ${{env.EM_VERSION}}
49
- actions-cache-folder : ${{env.EM_CACHE_FOLDER}}
75
+ - name : Get Conan dependencies
76
+ shell : bash
77
+ working-directory : ${{github.workspace}}
78
+ run : |
79
+ conan profile detect --force
80
+ conan create conan/observable_unique_ptr \
81
+ -pr default \
82
+ -pr ./conan/profiles/${{matrix.platform.os}}-${{matrix.platform.arch}}-${{matrix.platform.compiler}}
83
+ conan install . \
84
+ --build=missing \
85
+ -c tools.system.package_manager:mode=install \
86
+ -c tools.system.package_manager:sudo=true \
87
+ --output-folder dependencies \
88
+ -pr:b default \
89
+ -pr:h default \
90
+ -pr:h ./conan/profiles/${{matrix.platform.os}}-${{matrix.platform.arch}}-${{matrix.platform.compiler}}
50
91
51
92
- name : Create Build Environment
52
93
run : cmake -E make_directory ${{github.workspace}}/build
53
94
54
- - name : Get Linux dependencies
55
- if : runner.os == 'Linux' && matrix.platform.compiler != 'em++'
56
- run : |
57
- sudo apt-get update
58
- sudo apt-get install libz-dev libpng-dev libfreetype6-dev libglew-dev libglu1-mesa-dev libsfml-dev liblua5.2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-dev
59
-
60
- - name : Get Emscripten dependencies
61
- if : matrix.platform.compiler == 'em++'
62
- shell : bash
63
- working-directory : ${{github.workspace}}/dependencies
64
- run : unzip wasm.zip
65
-
66
- - name : Get Windows dependencies
67
- if : runner.os == 'Windows'
68
- # Ideally (but too slow):
69
- # run: vcpkg install sfml lua zlib libpng freetype glew sdl2 sdl2-ttf sdl2-image
70
- # Pre-compiled dependencies:
71
- shell : bash
72
- working-directory : ${{github.workspace}}/dependencies
73
- run : unzip windows-dependencies-${{matrix.platform.compiler}}-${{matrix.platform.arch}}.zip
74
-
75
- - name : Get MacOS dependencies
76
- if : runner.os == 'macOS'
77
- run : brew install sfml@2 lua libpng freetype glew sdl2 sdl2_ttf sdl2_image
78
-
79
95
- name : Configure CMake
80
96
shell : bash
81
97
working-directory : ${{github.workspace}}/build
82
- run : ${{matrix.platform.cmakepp}} cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLXGUI_BUILD_EXAMPLES=0 -DCMAKE_INSTALL_PREFIX=`pwd`/../dependencies ${{matrix.platform.flags}}
98
+ run : |
99
+ source ../dependencies/conanbuild.sh
100
+ cmake .. \
101
+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
102
+ -DCMAKE_TOOLCHAIN_FILE=`pwd`/../dependencies/conan_toolchain.cmake \
103
+ -DLXGUI_BUILD_EXAMPLES=OFF \
104
+ -DLXGUI_DEV=ON \
105
+ -DCMAKE_INSTALL_PREFIX=`pwd`/../install \
106
+ ${{matrix.platform.cmake-flags}}
83
107
84
108
- name : Build
85
109
shell : bash
86
110
working-directory : ${{github.workspace}}/build
87
- run : cmake --build . --config ${BUILD_TYPE} --parallel 2
111
+ run : |
112
+ source ../dependencies/conanbuild.sh
113
+ cmake --build . --config ${BUILD_TYPE} --parallel 2
88
114
89
115
- name : Install
90
116
shell : bash
91
117
working-directory : ${{github.workspace}}/build
92
- run : cmake --install . --config ${BUILD_TYPE}
118
+ run : |
119
+ source ../dependencies/conanbuild.sh
120
+ cmake --install . --config ${BUILD_TYPE}
93
121
94
122
- name : Build example SDL
95
123
shell : bash
96
124
working-directory : ${{github.workspace}}/build
97
125
run : |
98
126
rm -rf *
99
- ${{matrix.platform.cmakepp}} cmake ../examples/sdl${{matrix.platform.suffix}} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_PREFIX_PATH=`pwd`/../dependencies ${{matrix.platform.flags}}
127
+ source ../dependencies/conanbuild.sh
128
+ cmake ../examples/sdl${{matrix.platform.suffix}} \
129
+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
130
+ -DCMAKE_TOOLCHAIN_FILE=`pwd`/../dependencies/conan_toolchain.cmake \
131
+ -DCMAKE_PREFIX_PATH=`pwd`/../install
100
132
cmake --build . --config ${BUILD_TYPE} --parallel 2
101
133
102
134
- name : Build example OpenGL-SDL
103
135
shell : bash
104
136
working-directory : ${{github.workspace}}/build
105
137
run : |
106
138
rm -rf *
107
- ${{matrix.platform.cmakepp}} cmake ../examples/opengl-sdl${{matrix.platform.suffix}} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_PREFIX_PATH=`pwd`/../dependencies ${{matrix.platform.flags}}
139
+ source ../dependencies/conanbuild.sh
140
+ cmake ../examples/opengl-sdl${{matrix.platform.suffix}} \
141
+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
142
+ -DCMAKE_TOOLCHAIN_FILE=`pwd`/../dependencies/conan_toolchain.cmake \
143
+ -DCMAKE_PREFIX_PATH=`pwd`/../install
108
144
cmake --build . --config ${BUILD_TYPE} --parallel 2
109
145
110
146
- name : Build example SFML
@@ -113,7 +149,11 @@ jobs:
113
149
working-directory : ${{github.workspace}}/build
114
150
run : |
115
151
rm -rf *
116
- ${{matrix.platform.cmakepp}} cmake ../examples/sfml${{matrix.platform.suffix}} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_PREFIX_PATH=`pwd`/../dependencies ${{matrix.platform.flags}}
152
+ source ../dependencies/conanbuild.sh
153
+ cmake ../examples/sfml${{matrix.platform.suffix}} \
154
+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
155
+ -DCMAKE_TOOLCHAIN_FILE=`pwd`/../dependencies/conan_toolchain.cmake \
156
+ -DCMAKE_PREFIX_PATH=`pwd`/../install
117
157
cmake --build . --config ${BUILD_TYPE} --parallel 2
118
158
119
159
- name : Build example OpenGL-SFML
@@ -122,7 +162,11 @@ jobs:
122
162
working-directory : ${{github.workspace}}/build
123
163
run : |
124
164
rm -rf *
125
- ${{matrix.platform.cmakepp}} cmake ../examples/opengl-sfml${{matrix.platform.suffix}} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_PREFIX_PATH=`pwd`/../dependencies ${{matrix.platform.flags}}
165
+ source ../dependencies/conanbuild.sh
166
+ cmake ../examples/opengl-sfml${{matrix.platform.suffix}} \
167
+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
168
+ -DCMAKE_TOOLCHAIN_FILE=`pwd`/../dependencies/conan_toolchain.cmake \
169
+ -DCMAKE_PREFIX_PATH=`pwd`/../install
126
170
cmake --build . --config ${BUILD_TYPE} --parallel 2
127
171
128
172
- name : Prepare publish package
0 commit comments