Skip to content

Commit 023e788

Browse files
Regularlize includes and add linux support
1 parent 794ce0d commit 023e788

254 files changed

Lines changed: 1135 additions & 1106 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.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: ZEngine Cmake Linux Workflow
2+
3+
on:
4+
push:
5+
branches: [ header-reorganization ]
6+
7+
jobs:
8+
Linux-Build:
9+
name: cmake-build-linux-debug
10+
runs-on: ubuntu-24.04
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Powershell Repository
17+
run: curl -O https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb
18+
19+
- name: Install External Dependencies
20+
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
21+
22+
- name: CMake Build
23+
run: .\Scripts\BuildEngine.ps1 -Configurations 'Debug' -RunClangFormat 0
24+
shell: pwsh
25+
26+
- name: Run Tests
27+
run: .\Scripts\RunTests.ps1 -Configurations 'Debug'
28+
shell: pwsh

.gitmodules

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

CMakeLists.txt

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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+
37
project (RendererEngine
48
VERSION 1.0
59
DESCRIPTION "Renderer Engine is an open-source 2D - 3D rendering engine written in C/C++"
@@ -12,12 +16,9 @@ set_property (GLOBAL PROPERTY USE_FOLDERS ON)
1216
#
1317
get_filename_component (ENLISTMENT_ROOT "." ABSOLUTE CACHE)
1418
get_filename_component (EXTERNAL_DIR "${ENLISTMENT_ROOT}/__externals" ABSOLUTE CACHE)
15-
get_filename_component (EXTERNAL_NUGET_DIR "${ENLISTMENT_ROOT}/__externals/nuget" ABSOLUTE CACHE)
1619

1720
include(${ENLISTMENT_ROOT}/Scripts/CMake/NuGet.cmake)
1821
include(${ENLISTMENT_ROOT}/Scripts/CMake/CppWinRT.cmake)
19-
include(${ENLISTMENT_ROOT}/dependencies.cmake)
20-
2122

2223
option (COPY_EXAMPLE_PROJECT "Copy example projects that show how to use Launcher" ON)
2324
option (LAUNCHER_ONLY "Build Launcher only" OFF)
@@ -41,40 +42,16 @@ endif()
4142

4243
# Externals dependencies
4344
#
44-
if (NOT LAUNCHER_ONLY)
45-
add_subdirectory (${EXTERNAL_DIR}/fmt)
46-
add_subdirectory (${EXTERNAL_DIR}/imgui)
47-
add_subdirectory (${EXTERNAL_DIR}/glfw)
48-
add_subdirectory (${EXTERNAL_DIR}/spdlog)
49-
add_subdirectory (${EXTERNAL_DIR}/glm)
50-
add_subdirectory (${EXTERNAL_DIR}/entt)
51-
add_subdirectory (${EXTERNAL_DIR}/assimp)
52-
add_subdirectory (${EXTERNAL_DIR}/stduuid)
53-
add_subdirectory (${EXTERNAL_DIR}/yaml-cpp)
54-
add_subdirectory (${EXTERNAL_DIR}/SPIRV-headers)
55-
add_subdirectory (${EXTERNAL_DIR}/SPIRV-Tools)
56-
add_subdirectory (${EXTERNAL_DIR}/glslang)
57-
add_subdirectory (${EXTERNAL_DIR}/SPIRV-Cross)
58-
add_subdirectory (${EXTERNAL_DIR}/gtest)
59-
add_subdirectory (${EXTERNAL_DIR}/VulkanMemoryAllocator)
60-
add_subdirectory (${EXTERNAL_DIR}/tlsf)
61-
add_subdirectory (${EXTERNAL_DIR}/rapidhash)
62-
add_subdirectory (${EXTERNAL_DIR}/CLI11)
63-
64-
set (CMAKE_PREFIX_PATH
65-
${CMAKE_PREFIX_PATH}
66-
${EXTERNAL_DIR}/Vulkan-Headers/build/install/share/cmake
67-
)
68-
add_subdirectory (${EXTERNAL_DIR}/Vulkan-Loader)
69-
70-
# Core engine lib is here
71-
#
72-
add_subdirectory (ZEngine)
73-
74-
# Editor is here
75-
#
76-
add_subdirectory (Tetragrama)
77-
endif ()
45+
46+
include(dependencies.cmake)
47+
48+
# Core engine lib is here
49+
#
50+
add_subdirectory (ZEngine)
51+
52+
# Editor is here
53+
#
54+
add_subdirectory (Tetragrama)
7855

7956
# Launcher is here
8057
#

Scripts/BuildEngine.ps1

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
113113
# Check the system name
114114
if ($IsLinux) {
115115
$systemName = "Linux"
116-
$cMakeGenerator
117116
}
118117
elseif ($IsMacOS) {
119118
$systemName = "Darwin"
@@ -131,7 +130,7 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
131130
[string]$BuildDirectoryName = "Result." + $systemName + "." + $architecture + "." + $BuildDirectoryNameExtension
132131
[string]$buildDirectoryPath = [IO.Path]::Combine($RepoRoot, $BuildDirectoryName)
133132
[string]$cMakeCacheVariableOverride = ""
134-
[string]$cMakeGenerator = ""
133+
[string]$cMakeGenerator = "-G Ninja"
135134

136135
# Create build directory
137136
if (-Not (Test-Path $buildDirectoryPath)) {
@@ -171,19 +170,14 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
171170
$cMakeCacheVariableOverride += ' -DCMAKE_CONFIGURATION_TYPES=Debug;Release '
172171
}
173172
"Linux" {
174-
$cMakeGenerator = "-G `"Unix Makefiles`""
175-
176173
# Set Linux build compiler
177-
$env:CC = '/usr/bin/gcc-11'
178-
$env:CXX = '/usr/bin/g++-11'
174+
$env:CC = 'gcc'
175+
$env:CXX = 'g++'
179176
}
180177
"Darwin" {
181178
$cMakeGenerator = "-G `"Xcode`""
182179
$cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.FRAMEWORK -join ' '
183180
}
184-
Default {
185-
throw 'This system is not supported'
186-
}
187181
}
188182

189183
if($LauncherOnly) {

Scripts/Shared.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ function Find-GlslangValidator () {
186186
function Find-ClangFormat () {
187187
$repoConfiguration = Get-RepositoryConfiguration
188188
$LLVMMinimumVersion = $repoConfiguration.Requirements.LLVM.Version
189-
$LLVMMaximumVersion = $repoConfiguration.Requirements.LLVM.MaximumVersion
190189

191190
$candidates = @(
192191
'clang-format'
@@ -204,7 +203,7 @@ function Find-ClangFormat () {
204203
if ($clangFormatCommand) {
205204
if ((& $clangFormatCommand --version | Out-String) -match "clang-format version ([\d\.]*)") {
206205
[Version] $clangFormatVersion = $Matches[1]
207-
if ((CompareVersion $clangFormatVersion $LLVMMinimumVersion) -and (CompareVersion $LLVMMaximumVersion $clangFormatVersion)) {
206+
if ((CompareVersion $clangFormatVersion $LLVMMinimumVersion)) {
208207
return $clangFormatCommand.Source
209208
}
210209
}

Tetragrama/CMakeLists.txt

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ project (Tetragrama
66
LANGUAGES CXX
77
)
88

9-
set (CMAKE_CXX_STANDARD_REQUIRED ON)
10-
set (CMAKE_CXX_STANDARD 20)
11-
129
file (GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
1310
file (GLOB_RECURSE CPP_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
1411

@@ -31,22 +28,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
3128
set_target_properties(${TARGET_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$(ProjectDir)$(Configuration)")
3229
endif ()
3330

34-
include(${EXTERNAL_DIR}/externals.cmake)
35-
3631
target_include_directories (${TARGET_NAME}
3732
PRIVATE
38-
.
39-
./Components
40-
./Components/Events
41-
./Controllers
42-
./Inputs
43-
./Layers
44-
./Messengers
45-
./Helpers
46-
./Importers
47-
./Serializers
48-
./Managers
49-
${ENLISTMENT_ROOT}/ZEngine
33+
${CMAKE_CURRENT_SOURCE_DIR}/..
5034
)
5135

5236
target_precompile_headers(${TARGET_NAME} PRIVATE pch.h)
@@ -62,4 +46,4 @@ target_link_libraries(${TARGET_NAME} PRIVATE
6246
imported::External_editorLibs
6347
)
6448

65-
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "zEngineEditor")
49+
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "zEngineEditor")

Tetragrama/Components/DemoUIComponent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <UIComponent.h>
2+
#include <Tetragrama/Components/UIComponent.h>
33
#include <imgui.h>
44

55
namespace Tetragrama::Components

Tetragrama/Components/DockspaceUIComponent.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#include <pch.h>
2-
#include <DockspaceUIComponent.h>
3-
#include <Editor.h>
4-
#include <Helpers/UIDispatcher.h>
5-
#include <Importers/AssimpImporter.h>
6-
#include <MessageToken.h>
7-
#include <Messengers/Messenger.h>
1+
#include <Tetragrama/Components/DockspaceUIComponent.h>
2+
#include <Tetragrama/Editor.h>
3+
#include <Tetragrama/Helpers/UIComponentDrawerHelper.h>
4+
#include <Tetragrama/Helpers/UIDispatcher.h>
5+
#include <Tetragrama/Importers/AssimpImporter.h>
6+
#include <Tetragrama/MessageToken.h>
7+
#include <Tetragrama/Messengers/Messenger.h>
88
#include <ZEngine/Logging/LoggerDefinition.h>
99
#include <fmt/format.h>
10-
#include <imgui/src/imgui_internal.h>
10+
#include <imgui.h>
11+
#include <ImGuizmo/ImGuizmo.h>
1112

1213
namespace fs = std::filesystem;
1314

Tetragrama/Components/DockspaceUIComponent.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
2-
#include <Importers/IAssetImporter.h>
3-
#include <Message.h>
4-
#include <Serializers/EditorSceneSerializer.h>
5-
#include <UIComponent.h>
2+
#include <Tetragrama/Components/UIComponent.h>
3+
#include <Tetragrama/Importers/IAssetImporter.h>
4+
#include <Tetragrama/Messengers/Message.h>
5+
#include <Tetragrama/Serializers/EditorSceneSerializer.h>
66
#include <imgui.h>
77

88
namespace Tetragrama::Components

Tetragrama/Components/Events/SceneTextureAvailableEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <UIComponentEvent.h>
2+
#include <Tetragrama/Components/Events/UIComponentEvent.h>
33

44
namespace Tetragrama::Components::Event
55
{

0 commit comments

Comments
 (0)