Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .github/workflows/Engine-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ jobs:
uses: ./.github/workflows/macOS-build.yml
with:
targetFramework: net8.0

linux:
needs: clang-format
uses: ./.github/workflows/linux-build.yml
with:
targetFramework: net8.0
55 changes: 55 additions & 0 deletions .github/workflows/job-cmakebuild-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: ZEngine Cmake Linux Workflow

on:
workflow_call:
inputs:
configuration:
type: string
default: 'Debug'
targetFramework:
type: string
default: 'net8.0'

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

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

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

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

- name: Install LLVM-20
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20

- name: Update the list of packages
run: sudo apt-get update

- name: Install Dependencies
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 cmake apt-transport-https software-properties-common gcc g++ powershell clang-format-20 glslang-tools libwayland-dev libxkbcommon-dev

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

- name: Publish Build Artifacts
uses: actions/upload-artifact@v4
with:
name: Build-linux-${{inputs.configuration}}
path: |
Result.Linux.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/publish/
Result.Linux.x64.${{inputs.configuration}}/__externals/Vulkan-Loader/loader/
Result.Linux.x64.${{inputs.configuration}}/ZEngine/tests/ZEngineTests
Result.Linux.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
!Result.Linux.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
!Result.Linux.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
!Result.Linux.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
29 changes: 29 additions & 0 deletions .github/workflows/job-deploy-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Deploy for linux
#
name: linux Deploy Workflow

on:
workflow_call:
inputs:
targetFramework:
type: string
required: true
configuration:
type: string
default: 'Release'

jobs:
deploy:
name: deploy-linux-${{ inputs.configuration }}
runs-on: ubuntu-24.04
steps:
- uses: actions/download-artifact@v4
with:
path: Result.Linux.x64.${{ inputs.configuration }}
name: Build-linux-Release

- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: linux-${{ inputs.configuration }}
path: Result.Linux.x64.${{inputs.configuration}}/Panzerfaust/${{ inputs.configuration }}/${{inputs.targetFramework}}/publish/
31 changes: 31 additions & 0 deletions .github/workflows/job-test-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Run tests for linux
#
name: linux Test Workflow

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

jobs:
test:
name: test-linux-${{ inputs.configuration }}
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: Build-linux-${{ inputs.configuration }}
path: Result.Linux.x64.${{ inputs.configuration }}

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

- name: Run Tests
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
shell: pwsh
78 changes: 27 additions & 51 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,35 @@
# @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:
inputs:
targetFramework:
required: true
type: string

jobs:
Linux-Build:
runs-on: ubuntu-latest
cmake-build:
strategy:
matrix:
buildConfiguration: [Debug, Release]

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/[email protected]
# 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
buildConfiguration: [Debug, Release]
uses: ./.github/workflows/job-cmakebuild-linux.yml
with:
configuration: ${{matrix.buildConfiguration}}
targetframework: ${{inputs.targetFramework}}

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

deploy:
needs: test
uses: ./.github/workflows/job-deploy-linux.yml
with:
configuration: Release
targetframework: ${{inputs.targetFramework}}

# - name: CMake Build
# run: .\Scripts\BuildEngine.ps1 -Configurations ${{matrix.buildConfiguration}}
# shell: pwsh
2 changes: 1 addition & 1 deletion Obelisk/EntryPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int applicationEntryPoint(int argc, char* argv[])
MemoryManager manager = {};
MemoryConfiguration config = {.DefaultSize = ZGiga(3u)};
manager.Initialize(config);
auto arena = &(manager.ArenaAllocator);
auto arena = &(manager.Allocator);

LoggerConfiguration logger_cfg = {};
Logger::Initialize(arena, logger_cfg);
Expand Down
16 changes: 16 additions & 0 deletions Panzerfaust/Panzerfaust.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ApplicationIcon>./Assets/avalonia-logo.ico</ApplicationIcon>
<BaseOutputPath Condition="$([MSBuild]::IsOSPlatform('Windows')) == 'true'">..\Result.Windows.x64.MultiConfig</BaseOutputPath>
<BaseOutputPath Condition="$([MSBuild]::IsOSPlatform('OSX')) == 'true'">..\Result.Darwin.x64.$(Configuration)</BaseOutputPath>
<BaseOutputPath Condition="$([MSBuild]::IsOSPlatform('Linux')) == 'true'">..\Result.Linux.x64.$(Configuration)</BaseOutputPath>
<Platforms>x64;arm64</Platforms>
</PropertyGroup>
<PropertyGroup Condition=" $([MSBuild]::IsOSPlatform('Windows')) == 'true' AND '$(Configuration)' == 'Debug' ">
Expand Down Expand Up @@ -56,6 +57,21 @@
<OutputPath>$(BaseOutputPath)\Panzerfaust\$(Configuration)</OutputPath>
<DefineConstants>TRACE;__MACOS__</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" $([MSBuild]::IsOSPlatform('Linux')) == 'true' AND '$(Configuration)' == 'Debug' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>$(BaseOutputPath)\Panzerfaust\$(Configuration)</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" $([MSBuild]::IsOSPlatform('Linux')) == 'true' AND '$(Configuration)' == 'Release' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>$(BaseOutputPath)\Panzerfaust\$(Configuration)</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
Expand Down
8 changes: 1 addition & 7 deletions Scripts/BuildEngine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
# Check the system name
if ($IsLinux) {
$systemName = "Linux"
$cMakeGenerator
}
elseif ($IsMacOS) {
$systemName = "Darwin"
Expand All @@ -131,7 +130,6 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
[string]$BuildDirectoryName = "Result." + $systemName + "." + $architecture + "." + $BuildDirectoryNameExtension
[string]$buildDirectoryPath = [IO.Path]::Combine($RepoRoot, $BuildDirectoryName)
[string]$cMakeCacheVariableOverride = ""
[string]$cMakeGenerator = ""

# Create build directory
if (-Not (Test-Path $buildDirectoryPath)) {
Expand Down Expand Up @@ -171,11 +169,7 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
$cMakeCacheVariableOverride += ' -DCMAKE_CONFIGURATION_TYPES=Debug;Release '
}
"Linux" {
$cMakeGenerator = "-G `"Unix Makefiles`""

# Set Linux build compiler
$env:CC = '/usr/bin/gcc-11'
$env:CXX = '/usr/bin/g++-11'
$cMakeGenerator = "-G `"Ninja`""
}
"Darwin" {
$cMakeGenerator = "-G `"Xcode`""
Expand Down
7 changes: 4 additions & 3 deletions Scripts/PostBuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ param (
[string[]] $SystemName = 'Windows',

[Parameter(HelpMessage="Architecture type to build, default to x64")]
[ValidateSet('win-x64', 'arm64', 'osx-x64', 'osx-arm64')]
[ValidateSet('win-x64', 'arm64', 'osx-x64', 'osx-arm64', 'linux-x64')]
[string[]] $Architectures = 'win-x64',

[Parameter(HelpMessage="Configuration type to build, default to Debug")]
Expand Down Expand Up @@ -103,7 +103,8 @@ $ContentsToProcess = @(
}
}
"Linux" {
@{ From = "$OuputBuildDirectory\Obelisk\$Configurations"; To = "$OuputBuildDirectory\Panzerfaust\$Configurations\$TargetFramework\Editor"}
@{ From = "$OuputBuildDirectory\Obelisk"; To = "$OuputBuildDirectory\Panzerfaust\$Configurations\$TargetFramework\Editor"}
@{ From = "$OuputBuildDirectory\Obelisk"; To = "$OuputBuildDirectory\Panzerfaust\$Configurations\$TargetFramework\publish\Editor"}
}
Default {
throw 'This system is not supported'
Expand Down Expand Up @@ -133,4 +134,4 @@ foreach ($item in $ContentsToProcess) {
[string]$ToDirectory = $content.To
Write-Host "Copied $name --> $ToDirectory"
}
}
}
6 changes: 4 additions & 2 deletions Scripts/RunTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function RunTests {
"Darwin" {
$testExecutablePath = Join-Path $OutputBuildDirectory -ChildPath "ZEngine/tests/$Configuration/ZEngineTests"
}
"Linux" {}
"Linux" {
$testExecutablePath = Join-Path $OutputBuildDirectory -ChildPath "ZEngine/tests/ZEngineTests"
}
Default {
throw 'This system is not supported'
}
Expand All @@ -79,7 +81,7 @@ function RunTests {
& $testExecutablePath
}
else {
Write-Warning "Test executable does not exist: $testExecutablePath"
Write-Error "Test executable does not exist: $testExecutablePath"
}
}

Expand Down
11 changes: 9 additions & 2 deletions Scripts/Shared.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ function Find-GlslangValidator () {
if ($IsMacOS) {
Join-Path -Path $shaderCCompilerPath -ChildPath "\bin\glslangValidator" # On macOS, the pipeline build might pick up this option...
}
if ($IsLinux) {
Join-Path -Path $shaderCCompilerPath -ChildPath "\bin\glslangValidator"
}
)

foreach ($GlslangValidatorProgram in $GlslangValidatorCandidates) {
Expand All @@ -189,14 +192,18 @@ function Find-ClangFormat () {
$LLVMMaximumVersion = $repoConfiguration.Requirements.LLVM.MaximumVersion

$candidates = @(
'clang-format'
if ($IsMacOS) {
$brewPrefixPath = Invoke-Expression -Command "& brew --prefix"
Join-Path $brewPrefixPath -ChildPath 'opt/llvm/bin/clang-format'
}
if ($IsWindows) {
Join-Path -Path $env:ProgramFiles -ChildPath 'LLVM\bin\clang-format.exe'
}
if ($IsLinux) {
'/usr/bin/clang-format'
'/usr/bin/clang-format-20'
}
'clang-format'
)

foreach ($candidate in $candidates) {
Expand Down Expand Up @@ -225,7 +232,7 @@ function Setup-ShaderCCompilerTool () {
$outputFile = Join-Path -Path $repositoryToolPath -ChildPath "ShaderCCompiler$outputFileExtension"
Write-Host "Downloading Shader Compiler Tools..."

$shaderCToolUrl = IF($IsWindows) {$repoConfiguration.Requirements.ShaderC.Windows.Url} Elseif($IsMacOS) {$repoConfiguration.Requirements.ShaderC.macOS.Url}
$shaderCToolUrl = IF($IsWindows) {$repoConfiguration.Requirements.ShaderC.Windows.Url} Elseif($IsMacOS) {$repoConfiguration.Requirements.ShaderC.macOS.Url} Elseif($IsLinux){$repoConfiguration.Requirements.ShaderC.Linux.Url}
Invoke-WebRequest -Uri $shaderCToolUrl -OutFile $outputFile

# Extract contents
Expand Down
2 changes: 1 addition & 1 deletion Tetragrama/Components/HierarchyViewUIComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <ZEngine/Windows/Inputs/Keyboard.h>
#include <ZEngine/Windows/Inputs/Mouse.h>
#include <glm/glm.hpp>
#include <gtc/type_ptr.hpp>
#include <glm/gtc/type_ptr.hpp>

using namespace ZEngine;
using namespace ZEngine::Helpers;
Expand Down
12 changes: 1 addition & 11 deletions ZEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,8 @@ project (ZEngine
LANGUAGES CXX C
)

# Compiler verification in Linux
#
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if ((NOT ${CMAKE_CXX_COMPILER_VERSION} MATCHES "11.*.*") AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
message(FATAL_ERROR "CLANG compiler version should be 11.*.* !")
elseif ((NOT ${CMAKE_CXX_COMPILER_VERSION} MATCHES "11.*.*") AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
message(FATAL_ERROR "GNU compiler version should be 11.*.* !")
endif ()
endif ()

set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_STANDARD 20)

add_subdirectory (ZEngine)
add_subdirectory (tests)
add_subdirectory (tests)
Loading
Loading