Skip to content

Code Restructure To Enable Linux and MacOS Builds, Plus Reduce Disk Usage and/or Build Times , Plus Help Readability of Source Files #455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ PenaltyBreakTemplateDeclaration: 100
PenaltyReturnTypeOnItsOwnLine: 300
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/Engine-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@ on:
branches: [ master, develop, arena-integration ]

jobs:
clang-format:
strategy:
matrix:
directories: [ZEngine, Tetragrama]
uses: ./.github/workflows/job-clangformat.yml
with:
srcDirectory: ${{ matrix.directories }}

windows:
needs: clang-format
uses: ./.github/workflows/windows-build.yml
with:
targetFramework: net8.0

macOS:
needs: clang-format
uses: ./.github/workflows/macOS-build.yml
with:
targetFramework: net8.0

linux:
uses: ./.github/workflows/linux-build.yml
5 changes: 1 addition & 4 deletions .github/workflows/job-clangformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: ZEngine Code Formatting

on:
workflow_call:
inputs:
srcDirectory:
type: string

jobs:
format:
Expand All @@ -15,5 +12,5 @@ jobs:
uses: actions/checkout@v4

- name: Checking formatting
run: .\Scripts\ClangFormat.ps1 -SourceDirectory ${{ github.workspace }}/${{ inputs.srcDirectory }} -RunAsCheck 1
run: .\Scripts\ClangFormat.ps1 -SourceDirectory ${{ github.workspace }} -RunAsCheck 1
shell: pwsh
31 changes: 31 additions & 0 deletions .github/workflows/job-cmakebuild-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ZEngine Cmake Linux Workflow

on:
workflow_call:
inputs:
configuration:
type: string
default: 'Debug'

jobs:
Linux-Build:
name: cmake-build-linux-${{ inputs.configuration }}
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Powershell Repository
run: curl -O https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb

- name: Install External Dependencies
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

- name: CMake Build
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
shell: pwsh

- name: Run Tests
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
shell: pwsh
21 changes: 9 additions & 12 deletions .github/workflows/job-cmakebuild-macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Dependencies
run: brew install vulkan-headers vulkan-loader vulkan-tools assimp spirv-headers spirv-tools spirv-cross glslang glfw glew yaml-cpp spdlog googletest

- name: CMake Build
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
shell: pwsh

- name: Publish Build Artifacts
uses: actions/upload-artifact@v4
with:
name: Build-macOS-${{ inputs.architecture }}-${{inputs.configuration}}
path: |
Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/osx-${{ inputs.architecture }}/publish/
Result.Darwin.x64.${{inputs.configuration}}/__externals/Vulkan-Loader/loader/${{ inputs.configuration }}/
Result.Darwin.x64.${{inputs.configuration}}/ZEngine/tests/${{inputs.configuration}}/
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
- name: Update access permission of ZEngineTests
run: chmod +x ./Result.Darwin.x64.${{ inputs.configuration }}/ZEngine/tests/ZEngineTests

- name: Run Tests
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
shell: pwsh
34 changes: 12 additions & 22 deletions .github/workflows/job-cmakebuild-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Vcpkg
run: git clone --depth=1 https://github.com/Microsoft/vcpkg; bootstrap-vcpkg.bat
shell: pwsh

- name: Install Vulkan
run: vcpkg install vulkan
shell: pwsh

- name: CMake Build
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
run: $env:CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"; .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
shell: pwsh

- name: Publish Build Artifacts
uses: actions/upload-artifact@v4
with:
name: Build-Windows-x64-${{inputs.configuration}}
path: |
Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/win-x64/publish/
Result.Windows.x64.MultiConfig/ZEngine/tests/${{inputs.configuration}}/
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/createdump.exe
- name: Run Tests
shell: pwsh
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}

- name: Publish Vulkan Build Artifacts
if: ${{ inputs.configuration == 'Release'}}
uses: actions/upload-artifact@v4
with:
name: Vulkan-build-x64-release
path: |
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.dll
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.exp
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.lib
2 changes: 1 addition & 1 deletion .github/workflows/job-test-macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
path: Result.Darwin.x64.${{ inputs.configuration }}

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

- name: Run Tests
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/job-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,3 @@ jobs:
path: Result.Windows.x64.MultiConfig
name: Build-Windows-x64-${{ inputs.configuration }}

- name: Download Vulkan Artifacts
uses: actions/download-artifact@v4
with:
path: vulkan-build
name: Vulkan-build-x64-release

- name: Run Tests
shell: pwsh
run: |
$env:PATH = ".\vulkan-build\;$env:PATH"
.\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
57 changes: 6 additions & 51 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,14 @@
# @JeanPhilippeKernel : Disabled because we only support Windows as platform for now
#
name: ZEngine Linux Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:

jobs:
Linux-Build:
runs-on: ubuntu-latest
cmake-build:
strategy:
matrix:
buildConfiguration: [Debug, Release]
buildConfiguration: [Debug, Release]
uses: ./.github/workflows/job-cmakebuild-linux.yml
with:
configuration: ${{matrix.buildConfiguration}}

steps:
- name: Checkout repository
uses: actions/checkout@v2

# - name: Checkout submodules
# run: git submodule update --init --recursive

# - name: Install development library
# 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

# - name: Install CMake
# uses: jwlawson/actions-setup-cmake@v1.9
# with:
# cmake-version: '3.20.x'

# - name: Install pre-requisite packages.
# run: sudo apt-get install -y wget apt-transport-https software-properties-common

# - name: Download the Microsoft repository GPG keys
# run: wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb

# - name: Register the Microsoft repository GPG keys
# run: sudo dpkg -i packages-microsoft-prod.deb

# - name: Update the list of packages after we added packages.microsoft.com
# run: sudo apt-get update

# - name: Install PowerShell
# run: sudo apt-get install -y powershell

# - name: Add GCC Toolchain repository
# run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test

# - name: Install GCC compiler
# run: sudo apt install -y gcc-11

# - name: Install G++ compiler
# run: sudo apt install -y g++-11

# - name: CMake Build
# run: .\Scripts\BuildEngine.ps1 -Configurations ${{matrix.buildConfiguration}}
# shell: pwsh
21 changes: 0 additions & 21 deletions .github/workflows/macOS-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,3 @@ jobs:
architecture: ${{ matrix.architecture }}
targetFramework: ${{inputs.targetFramework}}

test:
needs: cmake-build
strategy:
matrix:
testConfiguration: [Debug, Release]
architecture: [x64, arm64]
uses: ./.github/workflows/job-test-macOS.yml
with:
configuration: ${{matrix.testConfiguration}}
architecture: ${{ matrix.architecture }}

deploy:
needs: test
strategy:
matrix:
architecture: [x64, arm64]
uses: ./.github/workflows/job-deploy-macOS.yml
with:
configuration: Release
architecture: ${{ matrix.architecture }}
targetFramework: ${{inputs.targetFramework}}
15 changes: 0 additions & 15 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,3 @@ jobs:
configuration: ${{matrix.buildConfiguration}}
targetFramework: ${{inputs.targetFramework}}

test:
needs: cmake-build
strategy:
matrix:
testConfiguration: [Debug, Release]
uses: ./.github/workflows/job-test-windows.yml
with:
configuration: ${{matrix.testConfiguration}}

deploy:
needs: test
uses: ./.github/workflows/job-deploy-windows.yml
with:
configuration: Release
targetFramework: ${{inputs.targetFramework}}
69 changes: 0 additions & 69 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,69 +0,0 @@
[submodule "__externals/fmt"]
path = __externals/fmt
url = https://github.com/fmtlib/fmt
[submodule "__externals/stb"]
path = __externals/stb
url = https://github.com/nothings/stb
[submodule "__externals/imgui/src"]
path = __externals/imgui/src
url = https://github.com/ocornut/imgui
[submodule "__externals/spdlog"]
path = __externals/spdlog
url = https://github.com/gabime/spdlog
[submodule "__externals/glfw"]
path = __externals/glfw
url = https://github.com/glfw/glfw
[submodule "__externals/entt"]
path = __externals/entt
url = https://github.com/skypjack/entt
[submodule "__externals/assimp"]
path = __externals/assimp
url = https://github.com/assimp/assimp
[submodule "__externals/stduuid"]
path = __externals/stduuid
url = https://github.com/mariusbancila/stduuid
[submodule "__externals/yaml-cpp"]
path = __externals/yaml-cpp
url = https://github.com/jbeder/yaml-cpp
[submodule "__externals/ImGuizmo"]
path = __externals/ImGuizmo
url = https://github.com/CedricGuillemet/ImGuizmo
[submodule "__externals/SPIRV-Cross"]
path = __externals/SPIRV-Cross
url = https://github.com/KhronosGroup/SPIRV-Cross
[submodule "__externals/gtest"]
path = __externals/gtest
url = https://github.com/google/googletest
[submodule "__externals/VulkanMemoryAllocator"]
path = __externals/VulkanMemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
[submodule "__externals/nlohmann_json"]
path = __externals/nlohmann_json
url = https://github.com/nlohmann/json
[submodule "__externals/glslang"]
path = __externals/glslang
url = https://github.com/khronosGroup/glslang.git
[submodule "__externals/SPIRV-headers"]
path = __externals/SPIRV-headers
url = https://github.com/khronosGroup/SPIRV-headers.git
[submodule "__externals/SPIRV-Tools"]
path = __externals/SPIRV-Tools
url = https://github.com/khronosGroup/SPIRV-Tools
[submodule "__externals/Vulkan-Loader"]
path = __externals/Vulkan-Loader
url = https://github.com/KhronosGroup/Vulkan-Loader
[submodule "__externals/glm"]
path = __externals/glm
url = https://github.com/g-truc/glm
[submodule "__externals/Vulkan-Headers"]
path = __externals/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers
[submodule "__externals/tlsf/src"]
path = __externals/tlsf/src
url = https://github.com/mattconte/tlsf
[submodule "__externals/CLI11"]
path = __externals/CLI11
url = https://github.com/CLIUtils/CLI11
[submodule "__externals/rapidhash/src"]
path = __externals/rapidhash/src
url = https://github.com/Nicoshev/rapidhash
Loading