Skip to content

Commit 8595cb8

Browse files
Code Restructure To Reduce Disk Usage and Help Readability
- 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)
1 parent d8aa9f3 commit 8595cb8

262 files changed

Lines changed: 1339 additions & 1498 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.

.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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ jobs:
2424
uses: ./.github/workflows/macOS-build.yml
2525
with:
2626
targetFramework: net8.0
27+
28+
linux:
29+
needs: clang-format
30+
uses: ./.github/workflows/linux-build.yml
31+
with:
32+
targetFramework: net8.0

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ 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
@@ -32,9 +35,8 @@ jobs:
3235
with:
3336
name: Build-macOS-${{ inputs.architecture }}-${{inputs.configuration}}
3437
path: |
38+
Result.Darwin.x64.${{inputs.configuration}}/ZEngine/tests/
3539
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}}/
3840
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
3941
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
4042
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,27 @@ 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

2735
- name: Publish Build Artifacts
2836
uses: actions/upload-artifact@v4
2937
with:
3038
name: Build-Windows-x64-${{inputs.configuration}}
3139
path: |
32-
Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/win-x64/publish/
3340
Result.Windows.x64.MultiConfig/ZEngine/tests/${{inputs.configuration}}/
41+
Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/win-x64/publish/
3442
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
3543
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
3644
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
3745
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
3846
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/createdump.exe
39-
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-windows.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ 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-
3226
- name: Run Tests
3327
shell: pwsh
34-
run: |
35-
$env:PATH = ".\vulkan-build\;$env:PATH"
36-
.\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
28+
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}

.github/workflows/linux-build.yml

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,29 @@
33
name: ZEngine Linux Build
44

55
on:
6-
push:
7-
branches: [ master ]
8-
pull_request:
9-
branches: [ master ]
6+
workflow_call:
7+
inputs:
8+
targetFramework:
9+
type: string
10+
required: true
1011

1112
jobs:
1213
Linux-Build:
13-
runs-on: ubuntu-latest
14-
strategy:
15-
matrix:
16-
buildConfiguration: [Debug, Release]
14+
runs-on: ubuntu-24.04
1715

1816
steps:
1917
- name: Checkout repository
20-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
2119

22-
# - name: Checkout submodules
23-
# run: git submodule update --init --recursive
20+
- name: Install development library
21+
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
2422

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
23+
- name: Create CMake Build Directory
24+
run: mkdir ../build && cmake -B ../build -DCMAKE_BUILD_TYPE=Debug -G Ninja
2725

28-
# - name: Install CMake
29-
# uses: jwlawson/actions-setup-cmake@v1.9
30-
# with:
31-
# cmake-version: '3.20.x'
26+
- name: Build
27+
run: cmake --build ../build
3228

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
29+
- name: Test
30+
run: ctest .
31+
working-directory: ../build/ZEngine/tests

.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)