Skip to content

Commit bd68c0f

Browse files
committed
Pull Request JeanPhilippeKernel#462 Requested Changes
1 parent e2b7561 commit bd68c0f

File tree

8 files changed

+55
-34
lines changed

8 files changed

+55
-34
lines changed

.github/workflows/job-deploy-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/download-artifact@v4
2121
with:
22-
path: Result.Darwin.x64.${{ inputs.configuration }}
22+
path: Result.Linux.x64.${{ inputs.configuration }}
2323
name: Build-linux-Release
2424

2525
- name: Publish Artifacts

.github/workflows/linux-build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# @JeanPhilippeKernel
2-
#
31
name: ZEngine Linux Build
42

53
on:

Scripts/PostBuild.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ $ErrorActionPreference = "Stop"
4343
$TargetFramework = 'net8.0'
4444

4545
[string]$RepoRoot = [IO.Path]::Combine($PSScriptRoot, "..")
46-
[string]$OuputBuildDirectory = [IO.Path]::Combine($RepoRoot, "../builds/RendererEngine")
46+
[string]$OuputBuildDirectory = If($IsWindows) {
47+
[IO.Path]::Combine($RepoRoot, "Result.Windows.x64.MultiConfig")
48+
} Else {
49+
[IO.Path]::Combine($RepoRoot, "Result.$SystemName.x64.$Configurations")
50+
}
4751

4852
if($LauncherOnly) {
4953
Write-Host "Skipping resources copy..."

Scripts/Shared.ps1

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,31 +185,39 @@ function Find-GlslangValidator () {
185185

186186
function Find-ClangFormat () {
187187
$repoConfiguration = Get-RepositoryConfiguration
188+
$LLVMMinimumVersion = $repoConfiguration.Requirements.LLVM.Version
189+
$LLVMMaximumVersion = $repoConfiguration.Requirements.LLVM.MaximumVersion
188190

189191
$candidates = @(
190-
'clang-format'
191192
if ($IsMacOS) {
192193
$brewPrefixPath = Invoke-Expression -Command "& brew --prefix"
193194
Join-Path $brewPrefixPath -ChildPath 'opt/llvm/bin/clang-format'
194195
}
195196
if ($IsWindows) {
196197
Join-Path -Path $env:ProgramFiles -ChildPath 'LLVM\bin\clang-format.exe'
197198
}
199+
if ($IsLinux) {
200+
'/usr/bin/clang-format'
201+
}
202+
'clang-format'
198203
)
199204

200205
foreach ($candidate in $candidates) {
201206
$clangFormatCommand = Get-Command $candidate -ErrorAction SilentlyContinue
202207
if ($clangFormatCommand) {
208+
if ((& $clangFormatCommand --version | Out-String) -match "clang-format version ([\d\.]*)") {
209+
[Version] $clangFormatVersion = $Matches[1]
210+
if ((CompareVersion $clangFormatVersion $LLVMMinimumVersion) -and (CompareVersion $LLVMMaximumVersion $clangFormatVersion)) {
203211
return $clangFormatCommand.Source
212+
}
213+
}
204214
}
205215
}
206216

217+
throw "Failed to find clang-format min $LLVMMinimumVersion max $LLVMMaximumVersion. Tried: " + ($candidates -join ', ')
207218
}
208219

209220
function Setup-ShaderCCompilerTool () {
210-
if($IsLinux) {
211-
return
212-
}
213221
$repoConfiguration = Get-RepositoryConfiguration
214222
$repositoryToolPath = $repoConfiguration.Paths.Tools
215223

@@ -220,7 +228,7 @@ function Setup-ShaderCCompilerTool () {
220228
$outputFile = Join-Path -Path $repositoryToolPath -ChildPath "ShaderCCompiler$outputFileExtension"
221229
Write-Host "Downloading Shader Compiler Tools..."
222230

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

226234
# Extract contents

ZEngine/ZEngine/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ source_group (TREE ${PROJECT_SOURCE_DIR}/../Resources PREFIX "Resources Files" F
77

88
# ZEngine source files
99
#
10-
add_library (zEngineLib STATIC ${CPP_FILES_LIST})
10+
add_library (zEngineLib STATIC)
11+
12+
target_source(zEngineLib PRIVATE ${CPP_FILES_LIST})
1113

1214
target_include_directories (zEngineLib
1315
PUBLIC
@@ -48,19 +50,26 @@ target_include_directories (zEngineLib
4850

4951
target_precompile_headers(zEngineLib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/pch.h)
5052

53+
target_compile_definitions(zEngineLib PUBLIC GLM_ENABLE_EXPERIMENTAL)
54+
5155
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
5256
target_compile_definitions (zEngineLib PUBLIC ENABLE_VULKAN_VALIDATION_LAYER)
5357
endif()
58+
5459
target_compile_definitions (zEngineLib
5560
PUBLIC
5661
ZENGINE_PLATFORM
5762
ENABLE_VULKAN_SYNCHRONIZATION_LAYER
5863
YAML_CPP_STATIC_DEFINE
5964
)
6065

61-
target_link_libraries (zEngineLib PUBLIC imported::External_libs)
66+
target_link_libraries (zEngineLib PUBLIC imported::ZEngine_External_Dependencies)
6267

6368
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
6469
target_link_libraries (zEngineLib PUBLIC imported::cppwinrt_headers WindowsApp.lib)
6570
target_compile_definitions(zEngineLib PUBLIC NOMINMAX)
6671
endif()
72+
73+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
74+
target_link_libraries(zEngineLib PUBLIC stdc++fs)
75+
endif ()

__externals/externals.cmake

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@ add_subdirectory (${EXTERNAL_DIR}/imgui)
88
add_library(ImGuizmo)
99

1010
target_sources(ImGuizmo PRIVATE
11-
${EXTERNAL_DIR}/ImGuizmo/ImGuizmo.cpp)
12-
13-
target_include_directories(ImGuizmo PUBLIC ${EXTERNAL_DIR})
14-
15-
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
16-
target_compile_definitions (ImGuizmo PUBLIC ENABLE_VULKAN_VALIDATION_LAYER)
17-
endif()
11+
${EXTERNAL_DIR}/ImGuizmo/ImGuizmo.cpp
12+
)
1813

19-
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
20-
target_compile_definitions (ImGuizmo PUBLIC VK_USE_PLATFORM_WIN32_KHR)
21-
endif()
14+
target_compile_definitions(ImGuizmo PUBLIC IMGUI_DEFINE_MATH_OPERATORS)
2215

23-
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
24-
target_link_libraries(ImGuizmo PUBLIC stdc++fs)
25-
endif ()
16+
target_include_directories(ImGuizmo PUBLIC ${EXTERNAL_DIR}/ImGuizmo)
2617

2718
target_link_libraries(ImGuizmo PUBLIC imgui)
2819

@@ -45,17 +36,17 @@ add_subdirectory (${EXTERNAL_DIR}/rapidhash)
4536
add_subdirectory (${EXTERNAL_DIR}/CLI11)
4637
add_subdirectory (${EXTERNAL_DIR}/nlohmann_json)
4738

48-
add_library (ZEngineLibs INTERFACE)
49-
add_library(TetragramaLibs INTERFACE)
39+
add_library (ZEngine_External_Dependencies INTERFACE)
40+
add_library(Tetragrama_External_Dependencies INTERFACE)
5041

51-
target_include_directories(ZEngineLibs INTERFACE ${EXTERNAL_DIR})
42+
target_include_directories(ZEngine_External_Dependencies INTERFACE ${EXTERNAL_DIR})
5243

53-
target_link_libraries(TetragramaLibs INTERFACE
44+
target_link_libraries(Tetragrama_External_Dependencies INTERFACE
5445
CLI11::CLI11
5546
nlohmann_json::nlohmann_json
5647
)
5748

58-
target_link_libraries(ZEngineLibs INTERFACE
49+
target_link_libraries(ZEngine_External_Dependencies INTERFACE
5950
fmt::fmt
6051
glm::glm
6152
ImGuizmo
@@ -74,7 +65,6 @@ target_link_libraries(ZEngineLibs INTERFACE
7465
rapidhash
7566
)
7667

77-
target_compile_definitions(ZEngineLibs INTERFACE GLM_ENABLE_EXPERIMENTAL)
7868

79-
add_library(imported::External_libs ALIAS ZEngineLibs)
80-
add_library(imported::External_editorLibs ALIAS TetragramaLibs)
69+
add_library(imported::ZEngine_External_Dependencies ALIAS ZEngine_External_Dependencies)
70+
add_library(imported::External_editorLibs ALIAS Tetragrama_External_Dependencies)

__externals/imgui/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,13 @@ target_link_libraries(imgui PUBLIC
3030
Vulkan::Headers
3131
Vulkan::Loader)
3232

33-
target_compile_definitions(imgui PUBLIC GLFW_INCLUDE_VULKAN IMGUI_DEFINE_MATH_OPERATORS)
33+
target_compile_definitions(imgui PUBLIC GLFW_INCLUDE_VULKAN )
34+
35+
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
36+
target_compile_definitions (imgui PUBLIC ENABLE_VULKAN_VALIDATION_LAYER)
37+
endif()
38+
39+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
40+
target_compile_definitions (imgui PUBLIC VK_USE_PLATFORM_WIN32_KHR)
41+
endif()
42+

repoConfiguration.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
},
1111
"macOS": {
1212
"Url": "https://storage.googleapis.com/shaderc/artifacts/prod/graphics_shader_compiler/shaderc/macos/continuous_clang_release/472/20240708-061139/install.tgz"
13+
},
14+
"Linux": {
15+
"Url": "https://storage.googleapis.com/shaderc/artifacts/prod/graphics_shader_compiler/shaderc/linux/continuous_gcc_release/500/20250807-100822/install.tgz"
1316
}
1417
},
1518
"GlslangValidator": {
@@ -24,4 +27,4 @@
2427
"MaximumVersion": "20.2.0"
2528
}
2629
}
27-
}
30+
}

0 commit comments

Comments
 (0)