Skip to content

Commit bf8342f

Browse files
add fetch_content based config
1 parent 8e93cb0 commit bf8342f

10 files changed

Lines changed: 33 additions & 96 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
3434
- name: Update the list of packages after we added packages.microsoft.com
3535
run: sudo apt-get update
36-
36+
ǰ
3737
- name: Install development library
38-
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 libwayland-dev libxkbcommon-dev libassimp-dev libfmt-dev libstb-dev libglfw3-dev libspdlog-dev libglm-dev libyaml-cpp-dev nlohmann-json3-dev libcli11-dev
38+
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 libwayland-dev libxkbcommon-dev libassimp-dev libfmt-dev libstb-dev libglfw3-dev libspdlog-dev libyaml-cpp-dev nlohmann-json3-dev libcli11-dev
3939

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
name: Build-macOS-${{ inputs.architecture }}-${{inputs.configuration}}
3737
path: |
3838
Result.Darwin.${{inputs.architecture}}.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/osx-${{ inputs.architecture }}/publish/
39-
Result.Darwin.${{inputs.architecture}}.${{inputs.configuration}}/_deps/Vulkan-Loader/loader/${{ inputs.configuration }}/
39+
Result.Darwin.${{inputs.architecture}}.${{inputs.configuration}}/_deps/vulkan-Loader-build/loader/${{ inputs.configuration }}/
4040
Result.Darwin.${{inputs.architecture}}.${{inputs.configuration}}/ZEngine/tests/${{inputs.configuration}}/
4141
!Result.Darwin.${{inputs.architecture}}.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
4242
!Result.Darwin.${{inputs.architecture}}.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll

CMakeLists.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
cmake_minimum_required (VERSION 3.17 FATAL_ERROR)
22

3-
set (CMAKE_CXX_STANDARD_REQUIRED ON)
4-
set (CMAKE_CXX_STANDARD 20)
5-
set (CMAKE_CXX_EXTENSIONS OFF)
6-
73
project (RendererEngine
84
VERSION 1.0
95
DESCRIPTION "Renderer Engine is an open-source 2D - 3D rendering engine written in C/C++"
@@ -71,20 +67,20 @@ endif ()
7167
#
7268
set (SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
7369
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
74-
set (SYSTEM_ARCHITECTURE "win-x64")
70+
set (SYSTEM_ARCHITECTURE "x64")
7571
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
76-
set (SYSTEM_ARCHITECTURE "linux-x64")
72+
set (SYSTEM_ARCHITECTURE "x64")
7773
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
7874
if (MACOSX_ARCHITECTURE_ARM64)
79-
set (SYSTEM_ARCHITECTURE "osx-arm64")
75+
set (SYSTEM_ARCHITECTURE "arm64")
8076
else ()
81-
set (SYSTEM_ARCHITECTURE "osx-x64")
77+
set (SYSTEM_ARCHITECTURE "x64")
8278
endif ()
8379
endif ()
8480

8581
add_custom_target (AssembleContent ALL
8682
COMMENT "Copying assets and resources contents"
87-
COMMAND pwsh ${CMAKE_CURRENT_SOURCE_DIR}/Scripts/PostBuild.ps1 -SystemName ${SYSTEM_NAME} -Architectures ${SYSTEM_ARCHITECTURE} -Configurations $<IF:$<CONFIG:Debug>,Debug,Release> $<$<BOOL:${LAUNCHER_ONLY}>:-LauncherOnly>
83+
COMMAND pwsh ${CMAKE_CURRENT_SOURCE_DIR}/Scripts/PostBuild.ps1 -SystemName ${SYSTEM_NAME} -Architecture ${SYSTEM_ARCHITECTURE} -Configurations $<IF:$<CONFIG:Debug>,Debug,Release> $<$<BOOL:${LAUNCHER_ONLY}>:-LauncherOnly>
8884
)
8985

9086
if (NOT LAUNCHER_ONLY)

CMakePresets.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"name": "BaseOptions",
1111
"cacheVariables": {
1212
"CMAKE_BUILD_TYPE": "Debug",
13+
"CMAKE_CXX_STANDARD": "20",
14+
"CMAKE_CXX_STANDARD_REQUIRED": "ON",
15+
"CMAKE_CXX_EXTENSIONS": "OFF",
1316

1417
"VULKAN_HEADERS_ENABLE_INSTALL": "ON",
1518
"ENTT_INCLUDE_HEADERS": "ON",
@@ -40,13 +43,12 @@
4043
"YAML_CPP_FORMAT_SOURCE": "OFF",
4144
"YAML_BUILD_SHARED_LIBS": "OFF",
4245

43-
"USE_MASM": "OFF",
4446
"USE_GAS": "OFF",
4547

4648
"SPIRV_SKIP_EXECUTABLES": "ON",
4749
"SPIRV_SKIP_TESTS": "ON",
48-
"GLSLANG_ENABLE_INSTALL": "ON",
49-
"ALLOW_EXTERNAL_SPIRV_TOOLS": "OFF",
50+
"GLSLANG_ENABLE_INSTALL": "OFF",
51+
"ALLOW_EXTERNAL_SPIRV_TOOLS": "ON",
5052

5153
"SPIRV_CROSS_ENABLE_TESTS": "OFF",
5254
"CMAKE_POLICY_VERSION_MINIMUM": "3.5"
@@ -61,6 +63,7 @@
6163
"architecture": "x64",
6264
"cacheVariables": {
6365
"CMAKE_BUILD_TYPE": "Debug",
66+
"USE_MASM": "OFF",
6467
"CMAKE_CONFIGURATION_TYPES": "Debug"
6568
}
6669

Panzerfaust/Panzerfaust.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
99
<ApplicationIcon>./Assets/avalonia-logo.ico</ApplicationIcon>
1010
<BaseOutputPath Condition="$([MSBuild]::IsOSPlatform('Windows')) == 'true'">..\Result.Windows.x64.MultiConfig</BaseOutputPath>
11-
<BaseOutputPath Condition="$([MSBuild]::IsOSPlatform('OSX')) == 'true'">..\Result.Darwin.x64.$(Configuration)</BaseOutputPath>
11+
<BaseOutputPath Condition="$([MSBuild]::IsOSPlatform('OSX')) == 'true' AND $(RuntimeIdentifier) == 'osx-arm64'">..\Result.Darwin.arm64.$(Configuration)</BaseOutputPath>
12+
<BaseOutputPath Condition="$([MSBuild]::IsOSPlatform('OSX')) == 'true'i AND $(RuntimeIdentifier) == 'osx-x64'"">..\Result.Darwin.x64.$(Configuration)</BaseOutputPath>
1213
<BaseOutputPath Condition="$([MSBuild]::IsOSPlatform('Linux')) == 'true'">..\Result.Linux.x64.$(Configuration)</BaseOutputPath>
1314
<Platforms>x64;arm64</Platforms>
1415
</PropertyGroup>

Tetragrama/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
cmake_minimum_required (VERSION 3.17)
2+
3+
project (Tetragrama
4+
VERSION 1.0
5+
DESCRIPTION "Tetragrama, the ZEngine Editor"
6+
LANGUAGES CXX
7+
)
8+
9+
set (CMAKE_CXX_STANDARD_REQUIRED ON)
10+
set (CMAKE_CXX_STANDARD 20)
11+
112
file (GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
213
file (GLOB_RECURSE CPP_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
314

ZEngine/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ project (ZEngine
66
LANGUAGES CXX C
77
)
88

9+
set (CMAKE_CXX_STANDARD_REQUIRED ON)
10+
set (CMAKE_CXX_STANDARD 20)
11+
912
add_subdirectory (ZEngine)
1013
add_subdirectory (tests)

ZEngine/ZEngine/Maths/Math.cpp

Lines changed: 0 additions & 64 deletions
This file was deleted.

ZEngine/ZEngine/pch.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#pragma once
2-
#include <spdlog/sinks/stdout_color_sinks.h>
3-
#include <uuid.h>
42
#include <algorithm>
53
#include <chrono>
64
#include <cstdint>

dependencies.cmake

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
include(FetchContent)
22

3+
if(NOT MACOSX_ARCHITECTURE_ARM64)
34
set (CMAKE_PREFIX_PATH
45
${CMAKE_PREFIX_PATH}
5-
__tools/ShaderCCompiler/lib/cmake
6-
__tools/ShaderCCompiler/SPIRV-Tools/cmake
6+
__tools/ShaderCCompiler
77
)
8+
endif()
89

910
FetchContent_Declare(
1011
fmt
@@ -50,13 +51,6 @@ FetchContent_Declare(
5051
FIND_PACKAGE_ARGS
5152
)
5253

53-
FetchContent_Declare(
54-
glm
55-
GIT_REPOSITORY https://github.com/g-truc/glm.git
56-
GIT_SHALLOW TRUE
57-
FIND_PACKAGE_ARGS
58-
)
59-
6054
FetchContent_Declare(
6155
EnTT
6256
GIT_REPOSITORY https://github.com/skypjack/entt.git
@@ -192,7 +186,6 @@ FetchContent_MakeAvailable(
192186
stbimage
193187
glfw3
194188
spdlog
195-
glm
196189
EnTT
197190
assimp
198191
stduuid
@@ -245,8 +238,6 @@ target_link_libraries(imguizmo PUBLIC imgui)
245238

246239
add_library(External_libs INTERFACE)
247240

248-
target_compile_definitions(External_libs INTERFACE GLM_ENABLE_EXPERIMENTAL)
249-
250241
target_include_directories(External_libs
251242
INTERFACE
252243
${CMAKE_CURRENT_SOURCE_DIR}
@@ -260,15 +251,13 @@ target_include_directories(External_libs
260251
target_link_libraries(External_libs
261252
INTERFACE
262253
fmt::fmt
263-
glm::glm
264254
imguizmo
265255
spdlog::spdlog
266256
EnTT::EnTT
267257
assimp::assimp
268258
stduuid
269259
yaml-cpp::yaml-cpp
270260
spirv-cross-core
271-
SPIRV-Tools
272261
glslang::glslang
273262
glslang::glslang-default-resource-limits
274263
glslang::SPIRV

0 commit comments

Comments
 (0)