-
-
Notifications
You must be signed in to change notification settings - Fork 96
1268 lines (1100 loc) · 54.1 KB
/
ci.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI
on: [push, pull_request]
jobs:
linux:
runs-on: ubuntu-22.04
env:
GCC_VERSION: 12
CLANG_VERSION: 14
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo add-apt-repository --yes ppa:texus/raylib
sudo apt-get update
sudo apt-get -y install g++-$GCC_VERSION clang-$CLANG_VERSION clang-tidy-$CLANG_VERSION ninja-build cppcheck
sudo apt-get -y install libsfml-dev libsdl2-dev libsdl2-ttf-dev libglfw3-dev libraylib5-dev
- name: Build TGUI (recent gcc)
run: >
cmake -B TGUI-build-gcc -GNinja
-DCMAKE_CXX_CPPCHECK="cppcheck;--enable=all;--inline-suppr;--quiet;--suppress=*:*/extlibs/*;--suppress=preprocessorErrorDirective;--suppress=noExplicitConstructor;--suppress=unmatchedSuppression;--suppress=missingIncludeSystem;--suppress=useStlAlgorithm;--suppress=passedByValue;--suppress=unusedFunction;--suppress=virtualCallInConstructor"
-DCMAKE_INSTALL_PREFIX=TGUI-build-gcc/install
-DCMAKE_CXX_COMPILER=g++-$GCC_VERSION
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DCMAKE_UNITY_BUILD=OFF
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-gcc --config Debug --target install
- name: Build TGUI (recent clang)
run: >
cmake -B TGUI-build-clang -GNinja
-DCMAKE_CXX_COMPILER=clang++-$CLANG_VERSION
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-clang --config Release
- name: Test TGUIConfig.cmake
run: |
cmake -GNinja -DTGUI_DIR="$GITHUB_WORKSPACE/TGUI-build-gcc/install/lib/cmake/TGUI/" -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
test -e tests/cmake/build/TguiTest
#----------------------------------------
linux-latest-dev:
runs-on: ubuntu-20.04
env:
SFML_GITHUB_URL: https://github.com/SFML/SFML
SDL_GITHUB_URL: https://github.com/libsdl-org/SDL
SDL_TTF_GITHUB_URL: https://github.com/libsdl-org/SDL_ttf
GLFW_GITHUB_URL: https://github.com/glfw/glfw
RAYLIB_GITHUB_URL: https://github.com/raysan5/raylib
CMAKE_VERSION: 3.27
CMAKE_VERSION_PATCH: 4
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
with:
path: TGUI
- name: Lookup dependency versions
id: find-dependencies
run: |
echo "sfml-revision=$(git ls-remote $SFML_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
echo "sdl-revision=$(git ls-remote $SDL_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
echo "sdl-ttf-revision=$(git ls-remote $SDL_TTF_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
echo "glfw-revision=$(git ls-remote $GLFW_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
echo "raylib-revision=$(git ls-remote $RAYLIB_GITHUB_URL HEAD | cut -f1)" >> $GITHUB_OUTPUT
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: SFML_INSTALL
key: CACHE_LINUX_SFML_LATEST_${{ steps.find-dependencies.outputs.sfml-revision }}
- name: Cache SDL
uses: actions/cache@v4
id: cache-sdl
with:
path: SDL_INSTALL
key: CACHE_LINUX_SDL_LATEST_${{ steps.find-dependencies.outputs.sdl-revision }}
- name: Cache SDL_ttf
uses: actions/cache@v4
id: cache-sdl-ttf
with:
path: SDL_TTF_INSTALL
key: CACHE_LINUX_SDL_TTF_LATEST_${{ steps.find-dependencies.outputs.sdl-ttf-revision }}
- name: Cache GLFW
uses: actions/cache@v4
id: cache-glfw
with:
path: GLFW_INSTALL
key: CACHE_LINUX_GLFW_LATEST_${{ steps.find-dependencies.outputs.glfw-revision }}
- name: Cache raylib
uses: actions/cache@v4
id: cache-raylib
with:
path: RAYLIB_INSTALL
key: CACHE_LINUX_RAYLIB_LATEST_${{ steps.find-dependencies.outputs.raylib-revision }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install xorg-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libfreetype-dev ninja-build libwayland-dev libxkbcommon-dev
sudo sh -c 'wget -nv -O- "https://cmake.org/files/v${{env.CMAKE_VERSION}}/cmake-${{env.CMAKE_VERSION}}.${{env.CMAKE_VERSION_PATCH}}-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local'
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
git clone --depth 1 $SFML_GITHUB_URL SFML
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SFML_INSTALL -DBUILD_SHARED_LIBS=ON -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S SFML -B SFML-build
cmake --build SFML-build --config Debug --target install
- name: Build SDL
if: steps.cache-sdl.outputs.cache-hit != 'true'
run: |
git clone --single-branch --depth 1 $SDL_GITHUB_URL SDL
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SDL_INSTALL -DBUILD_SHARED_LIBS=ON -S SDL -B SDL-build
cmake --build SDL-build --config Debug --target install
- name: Build SDL_ttf
if: steps.cache-sdl-ttf.outputs.cache-hit != 'true'
run: |
git clone --recurse-submodules --single-branch --depth 1 $SDL_TTF_GITHUB_URL SDL_TTF
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SDL_TTF_INSTALL -DSDL3_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL3" -DBUILD_SHARED_LIBS=ON -S SDL_TTF -B SDL_TTF-build
cmake --build SDL_TTF-build --config Debug --target install
- name: Build GLFW
if: steps.cache-glfw.outputs.cache-hit != 'true'
run: |
git clone --depth 1 $GLFW_GITHUB_URL GLFW
cmake -GNinja -DCMAKE_INSTALL_PREFIX=GLFW_INSTALL -DBUILD_SHARED_LIBS=ON -S GLFW -B GLFW-build
cmake --build GLFW-build --config Debug --target install
- name: Build raylib
if: steps.cache-raylib.outputs.cache-hit != 'true'
run: |
git clone --depth 1 $RAYLIB_GITHUB_URL raylib
cmake -GNinja -DCMAKE_INSTALL_PREFIX=RAYLIB_INSTALL -DBUILD_SHARED_LIBS=ON -S raylib -B raylib-build
cmake --build raylib-build --config Debug --target install
- name: Build TGUI
working-directory: TGUI
run: >
CXXFLAGS="-fprofile-arcs -ftest-coverage -DTGUI_REMOVE_DEPRECATED_CODE"
cmake -B build
-DSFML_ROOT="$GITHUB_WORKSPACE/SFML_INSTALL"
-DSDL3_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL3/"
-DSDL3_ttf_DIR="$GITHUB_WORKSPACE/SDL_TTF_INSTALL/lib/cmake/SDL3_ttf/"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Debug
-DTGUI_CXX_STANDARD=20
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_ENABLE_DRAW_TESTS=ON
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
sudo make -C build -j$(nproc) install
- name: Run tests
working-directory: TGUI/build/tests
run: |
set -a && source ../../tests/EnableSoftwareRenderer.env && set +a
xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SFML_GRAPHICS
xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SFML_OPENGL3
xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_RENDERER
xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=RAYLIB
MESA_GL_VERSION_OVERRIDE=3.3 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_OPENGL3
MESA_GLES_VERSION_OVERRIDE=3.2 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_GLES2
MESA_GL_VERSION_OVERRIDE=4.1 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_TTF_OPENGL3
MESA_GLES_VERSION_OVERRIDE=3.0 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=SDL_TTF_GLES2
MESA_GL_VERSION_OVERRIDE=4.5 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=GLFW_OPENGL3
MESA_GLES_VERSION_OVERRIDE=2.0 xvfb-run --server-args="-screen 0, 1280x720x24" -a ./tests --backend=GLFW_GLES2
- name: Test TGUIConfig.cmake
working-directory: TGUI
run: >
cmake -GNinja -S tests/cmake -B tests/cmake/build
-DSFML_ROOT="$GITHUB_WORKSPACE/SFML_INSTALL/"
-DSDL3_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL3/"
-DSDL3_ttf_DIR="$GITHUB_WORKSPACE/SDL_TTF_INSTALL/lib/cmake/SDL3_ttf/"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
cmake --build tests/cmake/build --config Release
test -e tests/cmake/build/TguiTest
- name: Upload coverage reports to Codecov
working-directory: TGUI
run: |
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov -ga "-pr" -t ${{secrets.CODECOV_TOKEN}}
#----------------------------------------
linux-oldest:
runs-on: ubuntu-20.04
env:
SFML_VERSION: 2.5.1 # 2.5.0 has issue with mesa
SDL_VERSION: 2.0.18 # older versions aren't supported in SDL_RENDERER backend
SDL_TTF_VERSION: 2.0.15 # 2.0.14 has no cmake script
GLFW_VERSION: '3.2'
RAYLIB_VERSION: '4.2.0'
CMAKE_VERSION: '3.16'
CMAKE_VERSION_PATCH: 0
GCC_VERSION: 7
CLANG_VERSION: '6.0'
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: SFML_INSTALL
key: CACHE_LINUX_OLDEST_SFML_${{env.SFML_VERSION}}
- name: Cache SDL
uses: actions/cache@v4
id: cache-sdl
with:
path: SDL_INSTALL
key: CACHE_LINUX_OLDEST_SDL_${{env.SDL_VERSION}}
- name: Cache SDL_ttf
uses: actions/cache@v4
id: cache-sdl-ttf
with:
path: SDL_TTF_INSTALL
key: CACHE_LINUX_OLDEST_SDL_TTF_${{env.SDL_TTF_VERSION}}
- name: Cache GLFW
uses: actions/cache@v4
id: cache-glfw
with:
path: GLFW_INSTALL
key: CACHE_LINUX_OLDEST_GLFW_${{env.GLFW_VERSION}}
- name: Cache raylib
uses: actions/cache@v4
id: cache-raylib
with:
path: RAYLIB_INSTALL
key: CACHE_LINUX_OLDEST_RAYLIB_${{env.RAYLIB_VERSION}}
- name: Install build tools and dependencies
run: |
sudo apt-get update
sudo apt-get -y install g++-$GCC_VERSION clang-$CLANG_VERSION ninja-build
sudo apt-get -y install xorg-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libfreetype6-dev
sudo sh -c 'wget -nv -O- "https://cmake.org/files/v${{env.CMAKE_VERSION}}/cmake-${{env.CMAKE_VERSION}}.${{env.CMAKE_VERSION_PATCH}}-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local'
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
mkdir SFML
wget -nv -O- "https://github.com/SFML/SFML/archive/refs/tags/$SFML_VERSION.tar.gz" | tar --strip-components=1 -xz -C SFML
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SFML_INSTALL -DBUILD_SHARED_LIBS=ON -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S SFML -B SFML-build
cmake --build SFML-build --config Release --target install
- name: Build SDL
if: steps.cache-sdl.outputs.cache-hit != 'true'
run: |
mkdir SDL
wget -nv -O- "https://github.com/libsdl-org/SDL/archive/refs/tags/release-$SDL_VERSION.tar.gz" | tar --strip-components=1 -xz -C SDL
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SDL_INSTALL -DBUILD_SHARED_LIBS=ON -S SDL -B SDL-build
cmake --build SDL-build --config Release --target install
- name: Build SDL_ttf
if: steps.cache-sdl-ttf.outputs.cache-hit != 'true'
run: |
mkdir SDL_TTF
wget -nv -O- "https://github.com/libsdl-org/SDL_ttf/archive/refs/tags/release-$SDL_TTF_VERSION.tar.gz" | tar --strip-components=1 -xz -C SDL_TTF
cmake -GNinja -DCMAKE_INSTALL_PREFIX=SDL_TTF_INSTALL -DSDL2_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL2" -DBUILD_SHARED_LIBS=ON -S SDL_TTF -B SDL_TTF-build
cmake --build SDL_TTF-build --config Release --target install
- name: Build GLFW
if: steps.cache-glfw.outputs.cache-hit != 'true'
run: |
mkdir GLFW
wget -nv -O- "https://github.com/glfw/glfw/archive/refs/tags/$GLFW_VERSION.tar.gz" | tar --strip-components=1 -xz -C GLFW
cmake -GNinja -DCMAKE_INSTALL_PREFIX=GLFW_INSTALL -DBUILD_SHARED_LIBS=ON -S GLFW -B GLFW-build
cmake --build GLFW-build --config Release --target install
- name: Build raylib
if: steps.cache-raylib.outputs.cache-hit != 'true'
run: |
mkdir raylib
wget -nv -O- "https://github.com/raysan5/raylib/archive/refs/tags/$RAYLIB_VERSION.tar.gz" | tar --strip-components=1 -xz -C raylib
cmake -GNinja -DCMAKE_INSTALL_PREFIX=RAYLIB_INSTALL -DBUILD_SHARED_LIBS=ON -S raylib -B raylib-build
cmake --build raylib-build --config Release --target install
- name: Build TGUI (old gcc)
run: >
cmake -B TGUI-build-gcc -GNinja
-DCMAKE_CXX_COMPILER=g++-$GCC_VERSION
-DSFML_DIR="$GITHUB_WORKSPACE/SFML_INSTALL/lib/cmake/SFML/"
-DSDL2_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL2/"
-DSDL2_TTF_PATH="$GITHUB_WORKSPACE/SDL_TTF_INSTALL"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-gcc --config Release
- name: Build TGUI (old clang)
run: >
cmake -B TGUI-build-clang -GNinja
-DCMAKE_CXX_COMPILER=clang++-$CLANG_VERSION
-DSFML_DIR="$GITHUB_WORKSPACE/SFML_INSTALL/lib/cmake/SFML/"
-DSDL2_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL2/"
-DSDL2_TTF_PATH="$GITHUB_WORKSPACE/SDL_TTF_INSTALL"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=OFF
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_GLES2=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_GLES2=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_GLES2=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
sudo cmake --build TGUI-build-clang --config Debug --target install
- name: Test TGUIConfig.cmake
run: >
cmake -GNinja -S tests/cmake -B tests/cmake/build
-DSFML_DIR="$GITHUB_WORKSPACE/SFML_INSTALL/lib/cmake/SFML/"
-DSDL2_DIR="$GITHUB_WORKSPACE/SDL_INSTALL/lib/cmake/SDL2/"
-DSDL2_TTF_PATH="$GITHUB_WORKSPACE/SDL_TTF_INSTALL"
-Dglfw3_DIR="$GITHUB_WORKSPACE/GLFW_INSTALL/lib/cmake/glfw3/"
-Draylib_ROOT="$GITHUB_WORKSPACE/RAYLIB_INSTALL/"
cmake --build tests/cmake/build --config Debug
test -e tests/cmake/build/TguiTest
#----------------------------------------
linux-per-backend:
runs-on: ubuntu-22.04
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo add-apt-repository --yes ppa:texus/raylib
sudo apt-get update
sudo apt-get -y install ninja-build libsfml-dev libsdl2-dev libsdl2-ttf-dev libglfw3-dev libraylib5-dev
- name: Build TGUI (SFML_GRAPHICS)
run: >
cmake -B TGUI-build-SFML_GRAPHICS -GNinja
-DBUILD_SHARED_LIBS=OFF
-DSFML_STATIC_LIBRARIES=OFF
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=SFML_GRAPHICS
sudo cmake --build TGUI-build-SFML_GRAPHICS --config Release --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Release
- name: Build TGUI (SDL_RENDERER)
run: >
cmake -B TGUI-build-SDL_RENDERER -GNinja
-DBUILD_SHARED_LIBS=OFF
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=SDL_RENDERER
sudo cmake --build TGUI-build-SDL_RENDERER --config Debug --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
- name: Build TGUI (SDL_TTF_GLES2)
run: >
cmake -B TGUI-build-SDL_TTF_GLES2 -GNinja
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=20
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=SDL_TTF_GLES2
sudo cmake --build TGUI-build-SDL_TTF_GLES2 --config Release --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
- name: Build TGUI (SDL_OPENGL3)
run: >
cmake -B TGUI-build-SDL_OPENGL3 -GNinja
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=23
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=SDL_OPENGL3
sudo cmake --build TGUI-build-SDL_OPENGL3 --config Debug --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Release
- name: Build TGUI (GLFW_OPENGL3)
run: >
cmake -B TGUI-build-GLFW_OPENGL3 -GNinja
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=GLFW_OPENGL3
sudo cmake --build TGUI-build-GLFW_OPENGL3 --config Release --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
- name: Build TGUI (RAYLIB)
run: >
cmake -B TGUI-build-RAYLIB -GNinja
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DCMAKE_UNITY_BUILD=ON
-DTGUI_BACKEND=RAYLIB
sudo cmake --build TGUI-build-RAYLIB --config Debug --target install
cmake -GNinja -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Release
#----------------------------------------
windows: # Setup technically not allowed, backends have conflicting FreeType dependencies
runs-on: windows-2022
env:
SFML_VERSION: 2.6.0
SDL_VERSION: 2.28.3
SDL_TTF_VERSION: 2.20.2
GLFW_VERSION: '3.4'
RAYLIB_VERSION: '5.0'
FREETYPE_VERSION: 2.13.2
MSVC_TOOLSET_VERSION: 143 # VS2022
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
C:\msys64\usr\bin\wget.exe -nv https://github.com/SFML/SFML/releases/download/${env:SFML_VERSION}/SFML-${env:SFML_VERSION}-windows-vc17-32-bit.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/libsdl-org/SDL/releases/download/release-${env:SDL_VERSION}/SDL2-devel-${env:SDL_VERSION}-VC.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/libsdl-org/SDL_ttf/releases/download/release-${env:SDL_TTF_VERSION}/SDL2_ttf-devel-${env:SDL_TTF_VERSION}-VC.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/glfw/glfw/releases/download/${env:GLFW_VERSION}/glfw-${env:GLFW_VERSION}.bin.WIN32.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/raysan5/raylib/releases/download/${env:RAYLIB_VERSION}/raylib-${env:RAYLIB_VERSION}_win32_msvc16.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v${env:FREETYPE_VERSION}.zip
7z x SFML-${env:SFML_VERSION}-windows-vc17-32-bit.zip
7z x SDL2-devel-${env:SDL_VERSION}-VC.zip
7z x SDL2_ttf-devel-${env:SDL_TTF_VERSION}-VC.zip
7z x glfw-${env:GLFW_VERSION}.bin.WIN32.zip
7z x raylib-${env:RAYLIB_VERSION}_win32_msvc16.zip
7z x v${env:FREETYPE_VERSION}.zip
- name: Build TGUI
run: >
cmake -B TGUI-build -T v${env:MSVC_TOOLSET_VERSION} -A Win32
-DSFML_ROOT="${env:GITHUB_WORKSPACE}/SFML-${env:SFML_VERSION}/"
-DSDL2_DIR="${env:GITHUB_WORKSPACE}/SDL2-${env:SDL_VERSION}/cmake/"
-DSDL2_ttf_DIR="${env:GITHUB_WORKSPACE}/SDL2_ttf-${env:SDL_TTF_VERSION}/cmake/"
-DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN32/include"
-DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN32/lib-vc2022/glfw3dll.lib"
-Draylib_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/raylib-${env:RAYLIB_VERSION}_win32_msvc16/include"
-Draylib_LIBRARY="${env:GITHUB_WORKSPACE}/raylib-${env:RAYLIB_VERSION}_win32_msvc16/lib/raylibdll.lib"
-DFREETYPE_WINDOWS_BINARIES_PATH="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}"
-DCMAKE_INSTALL_PREFIX=TGUI-build/install
-DCMAKE_UNITY_BUILD=OFF
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=23
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build --config Debug --target install
- name: Test TGUIConfig.cmake
run: >
cmake -T v${env:MSVC_TOOLSET_VERSION} -A Win32 -S tests/cmake -B tests/cmake/build
-DTGUI_ROOT="${env:GITHUB_WORKSPACE}/TGUI-build/install"
-DSFML_ROOT="${env:GITHUB_WORKSPACE}/SFML-${env:SFML_VERSION}"
-DSDL2_DIR="${env:GITHUB_WORKSPACE}/SDL2-${env:SDL_VERSION}/cmake/"
-DSDL2_ttf_DIR="${env:GITHUB_WORKSPACE}/SDL2_ttf-${env:SDL_TTF_VERSION}/cmake/"
-DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN32/include"
-DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN32/lib-vc2022/glfw3dll.lib"
-Draylib_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/raylib-${env:RAYLIB_VERSION}_win32_msvc16/include"
-Draylib_LIBRARY="${env:GITHUB_WORKSPACE}/raylib-${env:RAYLIB_VERSION}_win32_msvc16/lib/raylibdll.lib"
cmake --build tests/cmake/build --config Debug
#----------------------------------------
windows-oldest: # Setup technically not allowed, backends have conflicting FreeType dependencies (linking statically won't even work)
runs-on: windows-2019
env:
SFML_VERSION: 2.5.0
SDL_VERSION: 2.0.6
SDL_TTF_VERSION: 2.0.14
FREETYPE_VERSION: 2.6.5
CMAKE_VERSION: 3.17
CMAKE_VERSION_PATCH: 5
MSVC_TOOLSET_VERSION: 141 # VS2017
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
C:\msys64\usr\bin\wget.exe -nv https://cmake.org/files/v${env:CMAKE_VERSION}/cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86.zip
C:\msys64\usr\bin\wget.exe -nv https://www.sfml-dev.org/files/SFML-${env:SFML_VERSION}-windows-vc15-32-bit.zip
C:\msys64\usr\bin\wget.exe -nv https://libsdl.org/release/SDL2-devel-${env:SDL_VERSION}-VC.zip
C:\msys64\usr\bin\wget.exe -nv https://libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-${env:SDL_TTF_VERSION}-VC.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v${env:FREETYPE_VERSION}.zip
7z x cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86.zip
7z x SFML-${env:SFML_VERSION}-windows-vc15-32-bit.zip
7z x SDL2-devel-${env:SDL_VERSION}-VC.zip
7z x SDL2_ttf-devel-${env:SDL_TTF_VERSION}-VC.zip
7z x v${env:FREETYPE_VERSION}.zip
- name: Build TGUI
run: >
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86/bin/cmake.exe"
-B TGUI-build -T "v${env:MSVC_TOOLSET_VERSION}" -A Win32
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML-${env:SFML_VERSION}/lib/cmake/SFML/"
-DSDL2_PATH="${env:GITHUB_WORKSPACE}/SDL2-${env:SDL_VERSION}"
-DSDL2_TTF_PATH="${env:GITHUB_WORKSPACE}/SDL2_ttf-${env:SDL_TTF_VERSION}"
-DFREETYPE_WINDOWS_BINARIES_PATH="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}"
-DCMAKE_INSTALL_PREFIX=TGUI-build/install
-DTGUI_OPTIMIZE_SINGLE_BUILD=ON
-DTGUI_OPTIMIZE_SINGLE_BUILD_THREADS=2
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86/bin/cmake.exe" --build TGUI-build --config Release --target install
- name: Test TGUIConfig.cmake
run: >
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86/bin/cmake.exe"
-T "v${env:MSVC_TOOLSET_VERSION}" -A Win32 -S tests/cmake -B tests/cmake/build
-DTGUI_DIR="${env:GITHUB_WORKSPACE}/TGUI-build/install/lib/cmake/TGUI/"
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML-${env:SFML_VERSION}/lib/cmake/SFML/"
-DSDL2_PATH="${env:GITHUB_WORKSPACE}/SDL2-${env:SDL_VERSION}"
-DSDL2_TTF_PATH="${env:GITHUB_WORKSPACE}/SDL2_ttf-${env:SDL_TTF_VERSION}"
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win32-x86/bin/cmake.exe" --build tests/cmake/build --config Release
#----------------------------------------
windows-clang:
runs-on: windows-2022
env:
SFML_VERSION: 2.6.1
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: |
SFML_INSTALL_CLANG_CL
SFML_INSTALL_LLVM_CLANG
key: CACHE_WINDOWS_CLANG_SFML_${{env.SFML_VERSION}}
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
C:\msys64\usr\bin\wget.exe -nv https://github.com/SFML/SFML/archive/refs/tags/${env:SFML_VERSION}.zip
7z x "${env:SFML_VERSION}.zip"
cmake -T ClangCL -A x64 -DCMAKE_INSTALL_PREFIX=SFML_INSTALL_CLANG_CL -DBUILD_SHARED_LIBS=ON -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S "SFML-${env:SFML_VERSION}" -B SFML-build-ClangCL
cmake --build SFML-build-ClangCL --config Release --target install
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -A Win32 -DCMAKE_INSTALL_PREFIX=SFML_INSTALL_LLVM_CLANG -DBUILD_SHARED_LIBS=OFF -DSFML_USE_STATIC_STD_LIBS=OFF -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S "SFML-${env:SFML_VERSION}" -B SFML-build-LLVM-Clang
cmake --build SFML-build-LLVM-Clang --config Debug --target install
- name: Build TGUI (ClangCL)
run: >
cmake -B TGUI-build-ClangCL -T ClangCL -A x64
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL_CLANG_CL/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=SFML_GRAPHICS
cmake --build TGUI-build-ClangCL --config Release
- name: Build TGUI (LLVM Clang)
run: >
cmake -B TGUI-build-LLVM-Clang -A Win32
-DCMAKE_CXX_COMPILER=clang++
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL_LLVM_CLANG/lib/cmake/SFML/"
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=OFF
-DTGUI_CXX_STANDARD=20
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=SFML_GRAPHICS
cmake --build TGUI-build-LLVM-Clang --config Debug
- name: Run tests
working-directory: TGUI-build-LLVM-Clang/tests/Debug
run: ./tests.exe
#----------------------------------------
windows-static-mt:
runs-on: windows-2019
env:
SFML_VERSION: 2.5.1
GLFW_VERSION: 3.3.10
FREETYPE_VERSION: 2.11.1
CMAKE_VERSION: 3.19
CMAKE_VERSION_PATCH: 8
MSVC_TOOLSET_VERSION: 142 # VS2019
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: SFML_INSTALL
key: CACHE_WINDOWS_STATIC_MT_SFML_${{env.SFML_VERSION}}
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
C:\msys64\usr\bin\wget.exe -nv https://github.com/SFML/SFML/archive/refs/tags/${env:SFML_VERSION}.zip
7z x "${env:SFML_VERSION}.zip"
cmake -T "v${env:MSVC_TOOLSET_VERSION}" -A x64 -DCMAKE_INSTALL_PREFIX=SFML_INSTALL -DBUILD_SHARED_LIBS=OFF -DSFML_USE_STATIC_STD_LIBS=ON -DSFML_BUILD_AUDIO=OFF -DSFML_BUILD_NETWORK=OFF -S "SFML-${env:SFML_VERSION}" -B SFML-build
cmake --build SFML-build --config Release --target install
- name: Download dependencies
run: |
C:\msys64\usr\bin\wget.exe -nv https://cmake.org/files/v${env:CMAKE_VERSION}/cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/glfw/glfw/releases/download/${env:GLFW_VERSION}/glfw-${env:GLFW_VERSION}.bin.WIN64.zip
C:\msys64\usr\bin\wget.exe -nv https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v${env:FREETYPE_VERSION}.zip
7z x cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64.zip
7z x glfw-${env:GLFW_VERSION}.bin.WIN64.zip
7z x v${env:FREETYPE_VERSION}.zip
- name: Build TGUI
run: >
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe"
-B TGUI-build -T "v${env:MSVC_TOOLSET_VERSION}" -A x64
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL/lib/cmake/SFML/"
-DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/include"
-DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/lib-vc2019/glfw3_mt.lib"
-DFREETYPE_WINDOWS_BINARIES_PATH="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}"
-DCMAKE_INSTALL_PREFIX=TGUI-build/install
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=OFF
-DTGUI_USE_STATIC_STD_LIBS=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe" --build TGUI-build --config Release --target install
- name: Test TGUIConfig.cmake
run: >
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe"
-T "v${env:MSVC_TOOLSET_VERSION}" -A x64 -S tests/cmake -B tests/cmake/build
-DTGUI_ROOT="${env:GITHUB_WORKSPACE}/TGUI-build/install"
-DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL/lib/cmake/SFML/"
-DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/include"
-DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/lib-vc2019/glfw3_mt.lib"
-DFREETYPE_INCLUDE_DIR_ft2build="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/include"
-DFREETYPE_INCLUDE_DIR_freetype2="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/include"
-DFREETYPE_LIBRARY="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/release static/vs2015-2022/win64/freetype.lib"
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
& "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe" --build tests/cmake/build --config Release
#----------------------------------------
macos:
runs-on: macos-latest
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install sfml sdl2 sdl2_ttf glfw ninja raylib
- name: Build TGUI (dylibs)
run: >
cmake -B TGUI-build-dylibs -GNinja
-DCMAKE_INSTALL_PREFIX=TGUI-build-dylibs/install
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DTGUI_BUILD_FRAMEWORK=OFF
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=OFF
-DTGUI_BUILD_GUI_BUILDER=OFF
-DTGUI_BUILD_TESTS=OFF
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-dylibs --config Debug --target install
cmake -GNinja -DTGUI_ROOT="$GITHUB_WORKSPACE/TGUI-build-dylibs/install/" -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
- name: Build TGUI (frameworks)
run: >
cmake -B TGUI-build-framework -GNinja
-DCMAKE_INSTALL_PREFIX=TGUI-build-frameworks/install
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DTGUI_BUILD_FRAMEWORK=ON
-DTGUI_CXX_STANDARD=17
-DTGUI_WARNINGS_AS_ERRORS=ON
-DTGUI_BUILD_EXAMPLES=ON
-DTGUI_BUILD_GUI_BUILDER=ON
-DTGUI_BUILD_TESTS=ON
-DTGUI_BACKEND=Custom
-DTGUI_HAS_BACKEND_SFML_GRAPHICS=ON
-DTGUI_HAS_BACKEND_SFML_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_RENDERER=ON
-DTGUI_HAS_BACKEND_SDL_OPENGL3=ON
-DTGUI_HAS_BACKEND_SDL_TTF_OPENGL3=ON
-DTGUI_HAS_BACKEND_GLFW_OPENGL3=ON
-DTGUI_HAS_BACKEND_RAYLIB=ON
cmake --build TGUI-build-framework --config Release --target install
cmake -GNinja -DTGUI_ROOT="$GITHUB_WORKSPACE/TGUI-build-frameworks/install/" -S tests/cmake -B tests/cmake/build
cmake --build tests/cmake/build --config Debug
#----------------------------------------
android-sdl:
runs-on: ubuntu-latest
env:
SDL_VERSION: 2.30.7 # Not released yet, so code below downloads latest version and ignores this for now
SDL_TTF_VERSION: 2.22.0
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
with:
path: TGUI
# TODO (once SDL 2.30.7 is released: wget -nv -O- "https://github.com/libsdl-org/SDL/archive/refs/tags/release-$SDL_VERSION.tar.gz" | tar --strip-components=1 -xz -C SDL2
- name: Download SDL
run: |
mkdir SDL2
mkdir SDL2_ttf
wget -nv -O- "https://github.com/libsdl-org/SDL/archive/refs/heads/release-2.30.x.tar.gz" | tar --strip-components=1 -xz -C SDL2
wget -nv -O- "https://github.com/libsdl-org/SDL_ttf/releases/download/release-$SDL_TTF_VERSION/SDL2_ttf-$SDL_TTF_VERSION.tar.gz" | tar --strip-components=1 -xz -C SDL2_ttf
- name: Build SDL_RENDERER project
working-directory: TGUI/examples/android/SDL_RENDERER
run: |
sed -i "s/^\(\s*\)abiFilters .*$/\1abiFilters 'arm64-v8a'/" app/build.gradle
sed -i "s/^\(\s*\)ndkVersion .*$/\1ndkVersion '${ANDROID_NDK_ROOT##*/}'/" app/build.gradle
./gradlew assembleRelease --info
- name: Build SDL_TTF_GLES2 project
working-directory: TGUI/examples/android/SDL_TTF_GLES2
run: |
cmake -DTGUI_BACKEND=Custom -S ../../.. -B TGUI-build
sed -i "s/^\(\s*\)abiFilters .*$/\1abiFilters 'x86_64'/" app/build.gradle
sed -i "s/^\(\s*\)ndkVersion .*$/\1ndkVersion '${ANDROID_NDK_ROOT##*/}'/" app/build.gradle
ln -s $GITHUB_WORKSPACE/SDL2 app/jni/SDL
ln -s $GITHUB_WORKSPACE/SDL2_ttf app/jni/SDL_TTF
ln -s $GITHUB_WORKSPACE/TGUI app/jni/TGUI
./gradlew assembleDebug --info
#----------------------------------------
android-sfml-graphics:
runs-on: ubuntu-latest
env:
SFML_VERSION: 2.6.0
ARCH_ABI: arm64-v8a
steps:
- name: Checkout TGUI
uses: actions/checkout@v4
- name: Cache SFML
uses: actions/cache@v4
id: cache-sfml
with:
path: |
SFML
SFML-build
key: CACHE_ANDROID_SFML_${{env.SFML_VERSION}}_ARCH_${{env.ARCH_ABI}}
- name: Install Android NDK
run: |
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;26.1.10909125"
ANDROID_NDK_ROOT=$(echo $ANDROID_SDK_ROOT/ndk/26.1.10909125)
echo "ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" >> $GITHUB_ENV
- name: Build SFML
if: steps.cache-sfml.outputs.cache-hit != 'true'
run: |
mkdir SFML
wget -nv -O- "https://github.com/SFML/SFML/archive/refs/tags/${SFML_VERSION}.tar.gz" | tar --strip-components=1 -xz -C SFML
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=23 -DCMAKE_ANDROID_NDK=${ANDROID_NDK_ROOT} -DCMAKE_ANDROID_ARCH_ABI=$ARCH_ABI -DCMAKE_ANDROID_STL_TYPE=c++_shared -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_AS_ERRORS=OFF -S SFML -B SFML-build
make -C SFML-build -j$(nproc)
- name: Install SFML into NDK
if: steps.cache-ndk.outputs.cache-hit != 'true'
working-directory: SFML-build
run: |
make install
- name: Build TGUI
run: >
cmake -B TGUI-build
-DCMAKE_SYSTEM_NAME=Android
-DCMAKE_SYSTEM_VERSION=23
-DCMAKE_ANDROID_NDK=${ANDROID_NDK_ROOT}
-DCMAKE_ANDROID_ARCH_ABI=$ARCH_ABI
-DCMAKE_ANDROID_STL_TYPE=c++_shared
-DCMAKE_UNITY_BUILD=ON
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Debug
-DTGUI_BACKEND=SFML_GRAPHICS
-DTGUI_CXX_STANDARD=14
-DTGUI_WARNINGS_AS_ERRORS=ON
make -C TGUI-build -j$(nproc) install
- name: Build example
working-directory: examples/android/SFML_GRAPHICS
run: ./gradlew assembleDebug -P NDK_VERSION=${ANDROID_NDK_ROOT##*/} -P ARCH_ABI=${ARCH_ABI} --info
#----------------------------------------
ios-sfml-graphics:
runs-on: macos-12
env:
SFML_VERSION: 2.6.x # At least 2.6.2 is required
steps:
- name: Checkout TGUI