Skip to content

Commit 2c75e41

Browse files
committed
Code Restructure To Enable Linux & MacOS Builds, Reduce Disk Usage and Help Readability
Closes #354 Closes #355 - Move from github-submodule structure to use CMake's native dependency management facilities. (https://cmake.org/cmake/help/latest/guide/using-dependencies/index.html). Ideally the dependencies are to be installed using native mechanisms like vcpkg on windows, the linux distribution package manager or homebrew for mac. CMake will find the installed versions as a first option but build the dependencies if not available in the Build Directory at Build time. The linux_build code action is an example of this working in linux. - Restructure The #include statements to indicate the project source, this prevents confusion and is easier to read at the source file. It is also a consistent way to describe the included header and to reason about the include structure. This also is to pave the way to converting to modules. - Explicit Code file declaration in CMake as opposed to File Globbing which is only run once during build system generation. When creating a new file, it is suggested to specify it in the CMake File which will enhance tracking and ensure that it is picked up at build time due to changes in the CMake Files. - Changed Bitmap.h to utf-8 from iso-8859 - Changed from MSVC style of pre-compiled headers, just using plain header includes for portability. Another benefit is storage savings as the pch file was taking up too much space(in my experience) - Changed CI workflow to remove separate test job and instead do the testing within the same instance that does the build - Also removed the clang-format CI step as a dependency of the other build systems. This was to first ensure successful building and testing on the various platforms. should likely be incorporated into the individual system build steps
1 parent d8aa9f3 commit 2c75e41

File tree

267 files changed

+1366
-1578
lines changed

Some content is hidden

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

267 files changed

+1366
-1578
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ PenaltyBreakTemplateDeclaration: 100
120120
PenaltyReturnTypeOnItsOwnLine: 300
121121
PointerAlignment: Left
122122
ReflowComments: true
123-
SortIncludes: true
123+
SortIncludes: false
124124
SortUsingDeclarations: true
125125
SpaceAfterCStyleCast: true
126126
SpaceAfterLogicalNot: false

.github/workflows/Engine-CI.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,15 @@ on:
55
branches: [ master, develop, arena-integration ]
66

77
jobs:
8-
clang-format:
9-
strategy:
10-
matrix:
11-
directories: [ZEngine, Tetragrama]
12-
uses: ./.github/workflows/job-clangformat.yml
13-
with:
14-
srcDirectory: ${{ matrix.directories }}
15-
168
windows:
17-
needs: clang-format
189
uses: ./.github/workflows/windows-build.yml
1910
with:
2011
targetFramework: net8.0
2112

2213
macOS:
23-
needs: clang-format
2414
uses: ./.github/workflows/macOS-build.yml
2515
with:
2616
targetFramework: net8.0
17+
18+
linux:
19+
uses: ./.github/workflows/linux-build.yml

.github/workflows/job-clangformat.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: ZEngine Code Formatting
22

33
on:
44
workflow_call:
5-
inputs:
6-
srcDirectory:
7-
type: string
85

96
jobs:
107
format:
@@ -15,5 +12,5 @@ jobs:
1512
uses: actions/checkout@v4
1613

1714
- name: Checking formatting
18-
run: .\Scripts\ClangFormat.ps1 -SourceDirectory ${{ github.workspace }}/${{ inputs.srcDirectory }} -RunAsCheck 1
15+
run: .\Scripts\ClangFormat.ps1 -SourceDirectory ${{ github.workspace }} -RunAsCheck 1
1916
shell: pwsh
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ZEngine Cmake Linux Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
configuration:
7+
type: string
8+
default: 'Debug'
9+
10+
jobs:
11+
Linux-Build:
12+
name: cmake-build-linux-${{ inputs.configuration }}
13+
runs-on: ubuntu-24.04
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Powershell Repository
20+
run: curl -O https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb
21+
22+
- name: Install External Dependencies
23+
run: sudo apt-get update && sudo apt-get install -y git libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev cmake gcc g++ ninja-build libassimp-dev libfmt-dev libimgui-dev libstb-dev libglfw3-dev libspdlog-dev libglm-dev libyaml-cpp-dev libspirv-cross-c-shared-dev spirv-cross spirv-tools glslang-dev glslang-tools nlohmann-json3-dev dotnet-runtime-8.0 libgtest-dev powershell
24+
25+
- name: CMake Build
26+
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
27+
shell: pwsh
28+
29+
- name: Run Tests
30+
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
31+
shell: pwsh

.github/workflows/job-cmakebuild-macOS.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
2525

26+
- name: Install Dependencies
27+
run: brew install vulkan-headers vulkan-loader vulkan-tools assimp spirv-headers spirv-tools spirv-cross glslang glfw glew yaml-cpp spdlog googletest
28+
2629
- name: CMake Build
2730
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
2831
shell: pwsh
2932

30-
- name: Publish Build Artifacts
31-
uses: actions/upload-artifact@v4
32-
with:
33-
name: Build-macOS-${{ inputs.architecture }}-${{inputs.configuration}}
34-
path: |
35-
Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/osx-${{ inputs.architecture }}/publish/
36-
Result.Darwin.x64.${{inputs.configuration}}/__externals/Vulkan-Loader/loader/${{ inputs.configuration }}/
37-
Result.Darwin.x64.${{inputs.configuration}}/ZEngine/tests/${{inputs.configuration}}/
38-
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
39-
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
40-
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
41-
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
33+
- name: Update access permission of ZEngineTests
34+
run: chmod +x ./Result.Darwin.x64.${{ inputs.configuration }}/ZEngine/tests/ZEngineTests
35+
36+
- name: Run Tests
37+
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
38+
shell: pwsh

.github/workflows/job-cmakebuild-windows.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,19 @@ jobs:
2020
- name: Checkout repository
2121
uses: actions/checkout@v4
2222

23+
- name: Install Vcpkg
24+
run: git clone --depth=1 https://github.com/Microsoft/vcpkg; bootstrap-vcpkg.bat
25+
shell: pwsh
26+
27+
- name: Install Vulkan
28+
run: vcpkg install vulkan
29+
shell: pwsh
30+
2331
- name: CMake Build
24-
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
32+
run: $env:CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"; .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
2533
shell: pwsh
2634

27-
- name: Publish Build Artifacts
28-
uses: actions/upload-artifact@v4
29-
with:
30-
name: Build-Windows-x64-${{inputs.configuration}}
31-
path: |
32-
Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/win-x64/publish/
33-
Result.Windows.x64.MultiConfig/ZEngine/tests/${{inputs.configuration}}/
34-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
35-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
36-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
37-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
38-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/createdump.exe
35+
- name: Run Tests
36+
shell: pwsh
37+
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
3938

40-
- name: Publish Vulkan Build Artifacts
41-
if: ${{ inputs.configuration == 'Release'}}
42-
uses: actions/upload-artifact@v4
43-
with:
44-
name: Vulkan-build-x64-release
45-
path: |
46-
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.dll
47-
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.exp
48-
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.lib

.github/workflows/job-test-macOS.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
path: Result.Darwin.x64.${{ inputs.configuration }}
2828

2929
- name: Update access permission of ZEngineTests
30-
run: chmod +x ./Result.Darwin.x64.${{ inputs.configuration }}/ZEngine/tests/${{ inputs.configuration }}/ZEngineTests
30+
run: chmod +x ./Result.Darwin.x64.${{ inputs.configuration }}/ZEngine/tests/ZEngineTests
3131

3232
- name: Run Tests
3333
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}

.github/workflows/job-test-windows.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,3 @@ jobs:
2323
path: Result.Windows.x64.MultiConfig
2424
name: Build-Windows-x64-${{ inputs.configuration }}
2525

26-
- name: Download Vulkan Artifacts
27-
uses: actions/download-artifact@v4
28-
with:
29-
path: vulkan-build
30-
name: Vulkan-build-x64-release
31-
32-
- name: Run Tests
33-
shell: pwsh
34-
run: |
35-
$env:PATH = ".\vulkan-build\;$env:PATH"
36-
.\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}

.github/workflows/linux-build.yml

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,14 @@
1-
# @JeanPhilippeKernel : Disabled because we only support Windows as platform for now
2-
#
31
name: ZEngine Linux Build
42

53
on:
6-
push:
7-
branches: [ master ]
8-
pull_request:
9-
branches: [ master ]
4+
workflow_call:
105

116
jobs:
12-
Linux-Build:
13-
runs-on: ubuntu-latest
7+
cmake-build:
148
strategy:
159
matrix:
16-
buildConfiguration: [Debug, Release]
10+
buildConfiguration: [Debug, Release]
11+
uses: ./.github/workflows/job-cmakebuild-linux.yml
12+
with:
13+
configuration: ${{matrix.buildConfiguration}}
1714

18-
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v2
21-
22-
# - name: Checkout submodules
23-
# run: git submodule update --init --recursive
24-
25-
# - name: Install development library
26-
# run: sudo apt-get install libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev
27-
28-
# - name: Install CMake
29-
# uses: jwlawson/actions-setup-cmake@v1.9
30-
# with:
31-
# cmake-version: '3.20.x'
32-
33-
# - name: Install pre-requisite packages.
34-
# run: sudo apt-get install -y wget apt-transport-https software-properties-common
35-
36-
# - name: Download the Microsoft repository GPG keys
37-
# run: wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
38-
39-
# - name: Register the Microsoft repository GPG keys
40-
# run: sudo dpkg -i packages-microsoft-prod.deb
41-
42-
# - name: Update the list of packages after we added packages.microsoft.com
43-
# run: sudo apt-get update
44-
45-
# - name: Install PowerShell
46-
# run: sudo apt-get install -y powershell
47-
48-
# - name: Add GCC Toolchain repository
49-
# run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
50-
51-
# - name: Install GCC compiler
52-
# run: sudo apt install -y gcc-11
53-
54-
# - name: Install G++ compiler
55-
# run: sudo apt install -y g++-11
56-
57-
# - name: CMake Build
58-
# run: .\Scripts\BuildEngine.ps1 -Configurations ${{matrix.buildConfiguration}}
59-
# shell: pwsh

.github/workflows/macOS-build.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,3 @@ jobs:
1919
architecture: ${{ matrix.architecture }}
2020
targetFramework: ${{inputs.targetFramework}}
2121

22-
test:
23-
needs: cmake-build
24-
strategy:
25-
matrix:
26-
testConfiguration: [Debug, Release]
27-
architecture: [x64, arm64]
28-
uses: ./.github/workflows/job-test-macOS.yml
29-
with:
30-
configuration: ${{matrix.testConfiguration}}
31-
architecture: ${{ matrix.architecture }}
32-
33-
deploy:
34-
needs: test
35-
strategy:
36-
matrix:
37-
architecture: [x64, arm64]
38-
uses: ./.github/workflows/job-deploy-macOS.yml
39-
with:
40-
configuration: Release
41-
architecture: ${{ matrix.architecture }}
42-
targetFramework: ${{inputs.targetFramework}}

.github/workflows/windows-build.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,3 @@ jobs:
1717
configuration: ${{matrix.buildConfiguration}}
1818
targetFramework: ${{inputs.targetFramework}}
1919

20-
test:
21-
needs: cmake-build
22-
strategy:
23-
matrix:
24-
testConfiguration: [Debug, Release]
25-
uses: ./.github/workflows/job-test-windows.yml
26-
with:
27-
configuration: ${{matrix.testConfiguration}}
28-
29-
deploy:
30-
needs: test
31-
uses: ./.github/workflows/job-deploy-windows.yml
32-
with:
33-
configuration: Release
34-
targetFramework: ${{inputs.targetFramework}}

.gitmodules

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +0,0 @@
1-
[submodule "__externals/fmt"]
2-
path = __externals/fmt
3-
url = https://github.com/fmtlib/fmt
4-
[submodule "__externals/stb"]
5-
path = __externals/stb
6-
url = https://github.com/nothings/stb
7-
[submodule "__externals/imgui/src"]
8-
path = __externals/imgui/src
9-
url = https://github.com/ocornut/imgui
10-
[submodule "__externals/spdlog"]
11-
path = __externals/spdlog
12-
url = https://github.com/gabime/spdlog
13-
[submodule "__externals/glfw"]
14-
path = __externals/glfw
15-
url = https://github.com/glfw/glfw
16-
[submodule "__externals/entt"]
17-
path = __externals/entt
18-
url = https://github.com/skypjack/entt
19-
[submodule "__externals/assimp"]
20-
path = __externals/assimp
21-
url = https://github.com/assimp/assimp
22-
[submodule "__externals/stduuid"]
23-
path = __externals/stduuid
24-
url = https://github.com/mariusbancila/stduuid
25-
[submodule "__externals/yaml-cpp"]
26-
path = __externals/yaml-cpp
27-
url = https://github.com/jbeder/yaml-cpp
28-
[submodule "__externals/ImGuizmo"]
29-
path = __externals/ImGuizmo
30-
url = https://github.com/CedricGuillemet/ImGuizmo
31-
[submodule "__externals/SPIRV-Cross"]
32-
path = __externals/SPIRV-Cross
33-
url = https://github.com/KhronosGroup/SPIRV-Cross
34-
[submodule "__externals/gtest"]
35-
path = __externals/gtest
36-
url = https://github.com/google/googletest
37-
[submodule "__externals/VulkanMemoryAllocator"]
38-
path = __externals/VulkanMemoryAllocator
39-
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
40-
[submodule "__externals/nlohmann_json"]
41-
path = __externals/nlohmann_json
42-
url = https://github.com/nlohmann/json
43-
[submodule "__externals/glslang"]
44-
path = __externals/glslang
45-
url = https://github.com/khronosGroup/glslang.git
46-
[submodule "__externals/SPIRV-headers"]
47-
path = __externals/SPIRV-headers
48-
url = https://github.com/khronosGroup/SPIRV-headers.git
49-
[submodule "__externals/SPIRV-Tools"]
50-
path = __externals/SPIRV-Tools
51-
url = https://github.com/khronosGroup/SPIRV-Tools
52-
[submodule "__externals/Vulkan-Loader"]
53-
path = __externals/Vulkan-Loader
54-
url = https://github.com/KhronosGroup/Vulkan-Loader
55-
[submodule "__externals/glm"]
56-
path = __externals/glm
57-
url = https://github.com/g-truc/glm
58-
[submodule "__externals/Vulkan-Headers"]
59-
path = __externals/Vulkan-Headers
60-
url = https://github.com/KhronosGroup/Vulkan-Headers
61-
[submodule "__externals/tlsf/src"]
62-
path = __externals/tlsf/src
63-
url = https://github.com/mattconte/tlsf
64-
[submodule "__externals/CLI11"]
65-
path = __externals/CLI11
66-
url = https://github.com/CLIUtils/CLI11
67-
[submodule "__externals/rapidhash/src"]
68-
path = __externals/rapidhash/src
69-
url = https://github.com/Nicoshev/rapidhash

0 commit comments

Comments
 (0)