Skip to content

Commit d7bc2ad

Browse files
authored
New way of handling dependencies (#19)
* add deps/CMakeLists.txt, a cmake script that handle every dependencies * apply the new deps system to project * remove sub-directories as it is now downloaded via cmake * apply clang-format * refactor cmake_windows_mingw-w64.yml * use git am instead of apply, fix trailing whitespace in patches/0001-Bzip2-cmake-package.patch * retry git apply * windows workflow: remove vulkan-devel deps * update cmake_linux_gcc_64bit.yml * update codeql.yml * fix slash in path * remove -G options for linux * re2: use CMAKE_POSITION_INDEPENDENT_CODE=ON option * add options fpic to SDL and freetype * update cmake_macos.yml * add some warnings in order to fix the macos compilation (temporary) * fix tentative for the LZ4 lib on apple * remove comments, bump doctest to v2.4.11 * bump fmt -> 10.2.1, freetype -> 2.13.2, SDL2 -> 2.28.5, SDL2_image -> 2.8.2 * bump glslang -> 14.0.0 * made sure that the project is compatible with cmake install, add cmake package export, bump cmake version -> 3.23 * add a fix for INTERFACE_INCLUDE_DIRECTORIES in the Lz4 lib (linux and apple) * actions: enable install and upload artifacts * fix error on working_directory * actions: fix slash and upload path * fix default CMAKE_INSTALL_PREFIX * cleaning, fixing target name using 64/32 and _d suffix * add a throw if SDL_Vulkan_GetInstanceExtensions failed * remove the tools/fge_install, replaced by the install target * update README.md * Update copyrights
1 parent 204ca35 commit d7bc2ad

278 files changed

Lines changed: 886 additions & 1545 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cmake_linux_gcc_64bit.yml

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,64 @@ on:
66
types: [opened, reopened]
77

88
env:
9-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
109
BUILD_TYPE: Release
11-
ARCH: "64"
1210

1311
jobs:
1412
build:
15-
# The CMake configure and build commands are platform agnostic and should work equally
16-
# well on Windows or Mac. You can convert this to a matrix build if you need
17-
# cross-platform coverage.
18-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
1913
runs-on: ubuntu-latest
20-
14+
2115
steps:
22-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
2317
with:
2418
submodules: 'recursive'
25-
19+
2620
- name: Create Build Environment
27-
# Some projects don't allow in-source building, so create a separate build directory
28-
# We'll use this as our working directory for all subsequent commands
2921
run: cmake -E make_directory ${{github.workspace}}/build
30-
22+
3123
- name: Get number of CPU cores
32-
uses: SimenB/github-actions-cpu-cores@v1
24+
uses: SimenB/github-actions-cpu-cores@v2
3325
id: cpu-cores
34-
26+
3527
- name: Install gcc
3628
run: sudo apt-get update && sudo apt-get install gcc-11 g++-11
37-
29+
3830
- name: Install dependencies
3931
run: |
40-
sudo apt-get install libfreetype-dev libx11-dev libxrandr-dev libudev-dev \
32+
sudo apt-get install libx11-dev libxrandr-dev libudev-dev \
4133
libglu1-mesa-dev freeglut3-dev mesa-common-dev libflac-dev libogg-dev \
42-
libvorbis-dev libopenal-dev libxcursor-dev libvulkan-dev
43-
34+
libvorbis-dev libopenal-dev libxcursor-dev
35+
36+
- name: Handling project dependencies
37+
shell: bash
38+
working-directory: ${{github.workspace}}/deps
39+
run: |
40+
cmake . -D CMAKE_BUILD_TYPE=$BUILD_TYPE
41+
cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE
42+
4443
- name: Configure CMake
45-
# Use a bash shell so we can use the same syntax for environment variable
46-
# access regardless of the host operating system
4744
shell: bash
4845
working-directory: ${{github.workspace}}/build
49-
# Note the current convention is to use the -S and -B options here to specify source
50-
# and build directories, but this is only available with CMake 3.13 and higher.
51-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
52-
run: cmake $GITHUB_WORKSPACE -D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11 -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D TARGET_ARCH=$ARCH
53-
46+
run: cmake $GITHUB_WORKSPACE -D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11 -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D FGE_DEPS_PATH="deps/libs"
47+
5448
- name: Build
55-
working-directory: ${{github.workspace}}/build
5649
shell: bash
57-
# Execute the build. You can specify a specific target with "--target <NAME>"
50+
working-directory: ${{github.workspace}}/build
5851
run: cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE
59-
52+
6053
- name: Test
61-
working-directory: ${{github.workspace}}/build
6254
shell: bash
63-
# Execute tests defined by the CMake configuration.
64-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
55+
working-directory: ${{github.workspace}}/build
6556
run: ctest -C $BUILD_TYPE --verbose
57+
58+
- name: Installing
59+
shell: bash
60+
working-directory: ${{github.workspace}}/build
61+
run: cmake --install .
62+
63+
- uses: actions/upload-artifact@v4
64+
with:
65+
name: FastEngine-linux-64
66+
path: ${{github.workspace}}/install/FastEngine*
67+
if-no-files-found: error
68+
retention-days: 3
69+
compression-level: 9

.github/workflows/cmake_macos.yml

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,55 @@ on:
66
types: [opened, reopened]
77

88
env:
9-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
109
BUILD_TYPE: Release
11-
ARCH: "64"
1210

1311
jobs:
1412
build:
15-
# The CMake configure and build commands are platform agnostic and should work equally
16-
# well on Windows or Mac. You can convert this to a matrix build if you need
17-
# cross-platform coverage.
18-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
1913
runs-on: macos-latest
20-
14+
2115
steps:
22-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
2317
with:
2418
submodules: 'recursive'
25-
26-
- name: Configure Vulkan SDK
27-
uses: humbletim/setup-vulkan-sdk@v1.2.0
28-
with:
29-
vulkan-query-version: latest
30-
vulkan-components: Vulkan-Headers, Vulkan-Loader
31-
vulkan-use-cache: true
32-
19+
3320
- name: Create Build Environment
34-
# Some projects don't allow in-source building, so create a separate build directory
35-
# We'll use this as our working directory for all subsequent commands
3621
run: cmake -E make_directory ${{github.workspace}}/build
3722

3823
- name: Get number of CPU cores
39-
uses: SimenB/github-actions-cpu-cores@v1
24+
uses: SimenB/github-actions-cpu-cores@v2
4025
id: cpu-cores
4126

27+
- name: Handling project dependencies
28+
shell: bash
29+
working-directory: ${{github.workspace}}/deps
30+
run: |
31+
cmake . -D CMAKE_BUILD_TYPE=$BUILD_TYPE
32+
cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE
33+
4234
- name: Configure CMake
43-
# Use a bash shell so we can use the same syntax for environment variable
44-
# access regardless of the host operating system
4535
shell: bash
4636
working-directory: ${{github.workspace}}/build
47-
# Note the current convention is to use the -S and -B options here to specify source
48-
# and build directories, but this is only available with CMake 3.13 and higher.
49-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
50-
run: cmake $GITHUB_WORKSPACE -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D TARGET_ARCH=$ARCH
51-
37+
run: cmake $GITHUB_WORKSPACE -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D FGE_DEPS_PATH="deps/libs"
38+
5239
- name: Build
53-
working-directory: ${{github.workspace}}/build
5440
shell: bash
55-
# Execute the build. You can specify a specific target with "--target <NAME>"
41+
working-directory: ${{github.workspace}}/build
5642
run: cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE
57-
43+
5844
- name: Test
59-
working-directory: ${{github.workspace}}/build
6045
shell: bash
61-
# Execute tests defined by the CMake configuration.
62-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
46+
working-directory: ${{github.workspace}}/build
6347
run: ctest -C $BUILD_TYPE --verbose
48+
49+
- name: Installing
50+
shell: bash
51+
working-directory: ${{github.workspace}}/build
52+
run: cmake --install .
53+
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: FastEngine-apple
57+
path: ${{github.workspace}}/install/FastEngine*
58+
if-no-files-found: error
59+
retention-days: 3
60+
compression-level: 9

.github/workflows/cmake_windows_mingw-w64.yml

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
types: [opened, reopened]
77

88
env:
9-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
109
BUILD_TYPE: Release
1110

1211
jobs:
@@ -18,52 +17,60 @@ jobs:
1817
- { sys: mingw64, env: x86_64 }
1918
- { sys: mingw32, env: i686 }
2019

21-
# The CMake configure and build commands are platform agnostic and should work equally
22-
# well on Windows or Mac. You can convert this to a matrix build if you need
23-
# cross-platform coverage.
24-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
2520
runs-on: windows-latest
2621
defaults:
2722
run:
2823
shell: msys2 {0}
2924

3025
steps:
31-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
3227
with:
3328
submodules: 'recursive'
3429

3530
- uses: msys2/setup-msys2@v2
3631
with:
3732
msystem: ${{matrix.sys}}
3833
update: true
39-
install: git mingw-w64-${{matrix.env}}-vulkan-devel mingw-w64-${{matrix.env}}-gcc mingw-w64-${{matrix.env}}-cmake mingw-w64-${{matrix.env}}-make
40-
34+
install: git mingw-w64-${{matrix.env}}-gcc mingw-w64-${{matrix.env}}-cmake mingw-w64-${{matrix.env}}-make
35+
4136
- name: Create Build Environment
42-
# Some projects don't allow in-source building, so create a separate build directory
43-
# We'll use this as our working directory for all subsequent commands
4437
run: cmake -E make_directory "${{github.workspace}}\build"
45-
38+
4639
- name: Get number of CPU cores
47-
uses: SimenB/github-actions-cpu-cores@v1
40+
uses: SimenB/github-actions-cpu-cores@v2
4841
id: cpu-cores
49-
42+
43+
- name: Handling project dependencies
44+
shell: msys2 {0}
45+
working-directory: ${{github.workspace}}\deps
46+
run: |
47+
cmake . -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=$BUILD_TYPE
48+
cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE
49+
5050
- name: Configure CMake
5151
shell: msys2 {0}
5252
working-directory: ${{github.workspace}}\build
53-
# Note the current convention is to use the -S and -B options here to specify source
54-
# and build directories, but this is only available with CMake 3.13 and higher.
55-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
56-
run: cmake $GITHUB_WORKSPACE -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=$BUILD_TYPE
57-
53+
run: cmake $GITHUB_WORKSPACE -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D FGE_DEPS_PATH="deps/libs"
54+
5855
- name: Build
5956
shell: msys2 {0}
6057
working-directory: ${{github.workspace}}\build
61-
# Execute the build. You can specify a specific target with "--target <NAME>"
6258
run: cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE
63-
59+
6460
- name: Test
6561
shell: msys2 {0}
6662
working-directory: ${{github.workspace}}\build
67-
# Execute tests defined by the CMake configuration.
68-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
6963
run: ctest -C $BUILD_TYPE --verbose
64+
65+
- name: Installing
66+
shell: msys2 {0}
67+
working-directory: ${{github.workspace}}\build
68+
run: cmake --install .
69+
70+
- uses: actions/upload-artifact@v4
71+
with:
72+
name: FastEngine-windows-${{matrix.env}}-${{matrix.sys}}
73+
path: ${{github.workspace}}\install\FastEngine*
74+
if-no-files-found: error
75+
retention-days: 3
76+
compression-level: 9

.github/workflows/codeql.yml

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
121
name: "CodeQL"
132

143
env:
154
BUILD_TYPE: Release
16-
ARCH: "64"
175

186
on:
197
push:
208
branches: [ "master" ]
219
pull_request:
22-
# The branches below must be a subset of the branches above
2310
branches: [ "master" ]
2411
types: [opened, reopened]
2512
schedule:
@@ -33,29 +20,38 @@ jobs:
3320
actions: read
3421
contents: read
3522
security-events: write
36-
23+
3724
strategy:
3825
fail-fast: false
3926
matrix:
4027
language: [ 'cpp' ]
41-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
42-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
43-
28+
4429
steps:
4530
- name: Checkout repository
46-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
4732
with:
4833
submodules: 'recursive'
49-
34+
35+
- name: Get number of CPU cores
36+
uses: SimenB/github-actions-cpu-cores@v2
37+
id: cpu-cores
38+
5039
- name: Install gcc
5140
run: sudo apt-get update && sudo apt-get install gcc-11 g++-11
52-
41+
5342
- name: Install dependencies
5443
run: |
55-
sudo apt-get install libfreetype-dev libx11-dev libxrandr-dev libudev-dev \
44+
sudo apt-get install libx11-dev libxrandr-dev libudev-dev \
5645
libglu1-mesa-dev freeglut3-dev mesa-common-dev libflac-dev libogg-dev \
57-
libvorbis-dev libopenal-dev libxcursor-dev libvulkan-dev
58-
46+
libvorbis-dev libopenal-dev libxcursor-dev
47+
48+
- name: Handling project dependencies
49+
shell: bash
50+
working-directory: ${{github.workspace}}/deps
51+
run: |
52+
cmake . -D CMAKE_BUILD_TYPE=$BUILD_TYPE
53+
cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE
54+
5955
# Initializes the CodeQL tools for scanning.
6056
- name: Initialize CodeQL
6157
uses: github/codeql-action/init@v2
@@ -67,40 +63,19 @@ jobs:
6763

6864
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
6965
# queries: security-extended,security-and-quality
70-
71-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
66+
7267
- name: Create Build Environment
7368
run: cmake -E make_directory ${{github.workspace}}/build
74-
69+
7570
- name: Configure CMake
7671
shell: bash
7772
working-directory: ${{github.workspace}}/build
78-
run: cmake $GITHUB_WORKSPACE -D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11 -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D TARGET_ARCH=$ARCH
79-
80-
- name: Get number of CPU cores
81-
uses: SimenB/github-actions-cpu-cores@v1
82-
id: cpu-cores
73+
run: cmake $GITHUB_WORKSPACE -D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11 -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D FGE_DEPS_PATH="deps/libs"
8374

8475
- name: Build
8576
working-directory: ${{github.workspace}}/build
8677
shell: bash
87-
run: cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE --target FastEngine64
88-
78+
run: cmake --build . -j ${{steps.cpu-cores.outputs.count}} --config $BUILD_TYPE
79+
8980
- name: Perform CodeQL Analysis
9081
uses: github/codeql-action/analyze@v2
91-
with:
92-
upload: false
93-
output: sarif-results
94-
95-
- name: filter-sarif
96-
uses: advanced-security/filter-sarif@main
97-
with:
98-
patterns: |
99-
-**/libs/**
100-
input: sarif-results/${{ matrix.language }}.sarif
101-
output: sarif-results/${{ matrix.language }}.sarif
102-
103-
- name: Upload SARIF
104-
uses: github/codeql-action/upload-sarif@v2
105-
with:
106-
sarif_file: sarif-results/${{ matrix.language }}.sarif

0 commit comments

Comments
 (0)