diff --git a/.clang-format b/.clang-format index ec20f655..08fae016 100644 --- a/.clang-format +++ b/.clang-format @@ -120,7 +120,7 @@ PenaltyBreakTemplateDeclaration: 100 PenaltyReturnTypeOnItsOwnLine: 300 PointerAlignment: Left ReflowComments: true -SortIncludes: true +SortIncludes: false SortUsingDeclarations: true SpaceAfterCStyleCast: true SpaceAfterLogicalNot: false diff --git a/.github/workflows/Engine-CI.yml b/.github/workflows/Engine-CI.yml index 0951a413..a6ffa202 100644 --- a/.github/workflows/Engine-CI.yml +++ b/.github/workflows/Engine-CI.yml @@ -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 diff --git a/.github/workflows/job-clangformat.yml b/.github/workflows/job-clangformat.yml index 52c50f52..b20f45da 100644 --- a/.github/workflows/job-clangformat.yml +++ b/.github/workflows/job-clangformat.yml @@ -2,9 +2,6 @@ name: ZEngine Code Formatting on: workflow_call: - inputs: - srcDirectory: - type: string jobs: format: @@ -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 diff --git a/.github/workflows/job-cmakebuild-linux.yml b/.github/workflows/job-cmakebuild-linux.yml new file mode 100644 index 00000000..0e41cc43 --- /dev/null +++ b/.github/workflows/job-cmakebuild-linux.yml @@ -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 diff --git a/.github/workflows/job-cmakebuild-macOS.yml b/.github/workflows/job-cmakebuild-macOS.yml index 93f0bf70..823b6e2f 100644 --- a/.github/workflows/job-cmakebuild-macOS.yml +++ b/.github/workflows/job-cmakebuild-macOS.yml @@ -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 diff --git a/.github/workflows/job-cmakebuild-windows.yml b/.github/workflows/job-cmakebuild-windows.yml index 058056de..8422eeb6 100644 --- a/.github/workflows/job-cmakebuild-windows.yml +++ b/.github/workflows/job-cmakebuild-windows.yml @@ -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 diff --git a/.github/workflows/job-test-macOS.yml b/.github/workflows/job-test-macOS.yml index 62c22a6d..569582e9 100644 --- a/.github/workflows/job-test-macOS.yml +++ b/.github/workflows/job-test-macOS.yml @@ -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 }} diff --git a/.github/workflows/job-test-windows.yml b/.github/workflows/job-test-windows.yml index a3ba449d..73378526 100644 --- a/.github/workflows/job-test-windows.yml +++ b/.github/workflows/job-test-windows.yml @@ -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 }} diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 927ddaa3..ee33c1aa 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -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 diff --git a/.github/workflows/macOS-build.yml b/.github/workflows/macOS-build.yml index 4ab20d7c..e5e40ca2 100644 --- a/.github/workflows/macOS-build.yml +++ b/.github/workflows/macOS-build.yml @@ -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}} diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 04f0eb03..9098a922 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -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}} \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 2eaffaf6..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da817d2..c766840b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,88 +1,78 @@ -cmake_minimum_required (VERSION 3.17 FATAL_ERROR) +cmake_minimum_required(VERSION 3.17 FATAL_ERROR) -project (RendererEngine - VERSION 1.0 - DESCRIPTION "Renderer Engine is an open-source 2D - 3D rendering engine written in C/C++" - LANGUAGES CXX C -) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD 20) + +project( + RendererEngine + VERSION 1.0 + DESCRIPTION + "Renderer Engine is an open-source 2D - 3D rendering engine written in C/C++" + LANGUAGES CXX) -set_property (GLOBAL PROPERTY USE_FOLDERS ON) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Core invariants # -get_filename_component (ENLISTMENT_ROOT "." ABSOLUTE CACHE) -get_filename_component (EXTERNAL_DIR "${ENLISTMENT_ROOT}/__externals" ABSOLUTE CACHE) -get_filename_component (EXTERNAL_NUGET_DIR "${ENLISTMENT_ROOT}/__externals/nuget" ABSOLUTE CACHE) +get_filename_component(ENLISTMENT_ROOT "." ABSOLUTE CACHE) +get_filename_component(EXAMPLE_DIR "${ENLISTMENT_ROOT}/Examples" ABSOLUTE CACHE) include(${ENLISTMENT_ROOT}/Scripts/CMake/NuGet.cmake) -include(${ENLISTMENT_ROOT}/Scripts/CMake/CppWinRT.cmake) -include(${ENLISTMENT_ROOT}/dependencies.cmake) - - -option (COPY_EXAMPLE_PROJECT "Copy example projects that show how to use Launcher" ON) -option (LAUNCHER_ONLY "Build Launcher only" OFF) - -set (MACOSX_ARCHITECTURE_ARM64 OFF) -if (APPLE) - # Use uname to detect the macOS processor architecture - execute_process( - COMMAND uname -m - OUTPUT_VARIABLE MACOSX_ARCHITECTURE - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if (MACOSX_ARCHITECTURE STREQUAL "arm64") - set (MACOSX_ARCHITECTURE_ARM64 ON) - endif () -endif () + +option(COPY_EXAMPLE_PROJECT + "Copy example projects that show how to use Launcher" ON) +option(LAUNCHER_ONLY "Build Launcher only" OFF) + +set(MACOSX_ARCHITECTURE_ARM64 OFF) +if(APPLE) + # Use uname to detect the macOS processor architecture + execute_process( + COMMAND uname -m + OUTPUT_VARIABLE MACOSX_ARCHITECTURE + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(MACOSX_ARCHITECTURE STREQUAL "arm64") + set(MACOSX_ARCHITECTURE_ARM64 ON) + endif() +endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING) # Fix Warning from VS 2022 + endif() -# Externals dependencies +include(dependencies.cmake) + +# Core engine lib is here # -if (NOT LAUNCHER_ONLY) - add_subdirectory (${EXTERNAL_DIR}/fmt) - add_subdirectory (${EXTERNAL_DIR}/imgui) - add_subdirectory (${EXTERNAL_DIR}/glfw) - add_subdirectory (${EXTERNAL_DIR}/spdlog) - add_subdirectory (${EXTERNAL_DIR}/glm) - add_subdirectory (${EXTERNAL_DIR}/entt) - add_subdirectory (${EXTERNAL_DIR}/assimp) - add_subdirectory (${EXTERNAL_DIR}/stduuid) - add_subdirectory (${EXTERNAL_DIR}/yaml-cpp) - add_subdirectory (${EXTERNAL_DIR}/SPIRV-headers) - add_subdirectory (${EXTERNAL_DIR}/SPIRV-Tools) - add_subdirectory (${EXTERNAL_DIR}/glslang) - add_subdirectory (${EXTERNAL_DIR}/SPIRV-Cross) - add_subdirectory (${EXTERNAL_DIR}/gtest) - add_subdirectory (${EXTERNAL_DIR}/VulkanMemoryAllocator) - add_subdirectory (${EXTERNAL_DIR}/tlsf) - add_subdirectory (${EXTERNAL_DIR}/rapidhash) - add_subdirectory (${EXTERNAL_DIR}/CLI11) - - set (CMAKE_PREFIX_PATH - ${CMAKE_PREFIX_PATH} - ${EXTERNAL_DIR}/Vulkan-Headers/build/install/share/cmake - ) - add_subdirectory (${EXTERNAL_DIR}/Vulkan-Loader) - - # Core engine lib is here - # - add_subdirectory (ZEngine) - - # Editor is here - # - add_subdirectory (Tetragrama) -endif () +add_subdirectory(ZEngine) + +# Editor is here +# +add_subdirectory(Tetragrama) # Launcher is here # -add_subdirectory (Panzerfaust) + add_subdirectory (Panzerfaust) -if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - set_property (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Panzerfaust) -endif () +if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT + Panzerfaust) +endif() + +# Post build operation +# +set(SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) +if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + set(SYSTEM_ARCHITECTURE "win-x64") +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + set(SYSTEM_ARCHITECTURE "linux-x64") +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + if(MACOSX_ARCHITECTURE_ARM64) + set(SYSTEM_ARCHITECTURE "osx-arm64") + else() + set(SYSTEM_ARCHITECTURE "osx-x64") + endif() +endif() # Post build operation # diff --git a/README.md b/README.md index fa5582a6..0b326e35 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Before building, make sure your setup is correct : - Install [Python](https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe) - Install [CMake](https://cmake.org/download/) 3.20 or later. - Install [DOTNET SDK 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) as a VS Build Tool component (if using a standalone implementation, you might need to create a symlink between your custom installation location and the expected location: `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Sdks\Microsoft.NET.Sdk\Sdk`) -- Install [LLVM](https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/LLVM-18.1.8-win64.exe) +- Install [LLVM](https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.7/LLVM-20.1.7-win64.exe) ### Setup macOS machine @@ -59,7 +59,7 @@ Before building, make sure your setup is correct : - Install ClangFormat through Homebrew: ```bash brew update - brew install clang-format@18 + brew install llvm@20 ``` ## Building the engine & launcher diff --git a/Scripts/BuildEngine.ps1 b/Scripts/BuildEngine.ps1 index 0e24eefb..06317975 100644 --- a/Scripts/BuildEngine.ps1 +++ b/Scripts/BuildEngine.ps1 @@ -83,26 +83,6 @@ if ($IsWindows) { } -if(-Not $LauncherOnly) { - $RepoRoot = [IO.Path]::Combine($PSScriptRoot, "..") - Write-Host "Ensuring submodules are initialized and updated..." - & git -C $RepoRoot submodule update --init --recursive - - Write-Host "Configuring Vulkan-Header submodule..." - - $ExternalVulkanHeadersDir = Join-Path -Path $RepoRoot -ChildPath "__externals/Vulkan-Headers" - $ExternalVulkanHeadersOutputDir = Join-Path -Path $ExternalVulkanHeadersDir -ChildPath "build" - $ExternalVulkanHeadersInstallDir = Join-Path -Path $ExternalVulkanHeadersOutputDir -ChildPath "install" - - if(-Not (Test-Path -Path $ExternalVulkanHeadersInstallDir)) { - & $cMakeProgram -S $ExternalVulkanHeadersDir -B $ExternalVulkanHeadersOutputDir - & $cMakeProgram --install $ExternalVulkanHeadersOutputDir --prefix $ExternalVulkanHeadersInstallDir - } -} else { - Write-Host "Skipping submodules initialization..." -} - - function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) { $architecture = 'x64' @@ -113,7 +93,6 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) { # Check the system name if ($IsLinux) { $systemName = "Linux" - $cMakeGenerator } elseif ($IsMacOS) { $systemName = "Darwin" @@ -131,32 +110,13 @@ 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 = "" + [string]$cMakeGenerator = "-G Ninja" # Create build directory if (-Not (Test-Path $buildDirectoryPath)) { $Null = New-Item -ItemType Directory -Path $BuildDirectoryPath -ErrorAction SilentlyContinue } - # Define CMake Generator arguments - $cMakeOptions = " -DCMAKE_SYSTEM_NAME=$systemName", " -DCMAKE_BUILD_TYPE=$configuration" - $submoduleCMakeOptions = @{ - 'ENTT' = @("-DENTT_INCLUDE_HEADERS=ON") - 'SPDLOG' = @("-DSPDLOG_BUILD_SHARED=OFF", "-DBUILD_STATIC_LIBS=ON", "-DSPDLOG_FMT_EXTERNAL=ON", "-DSPDLOG_FMT_EXTERNAL_HO=OFF"); - 'GLFW ' = @("-DGLFW_BUILD_DOCS=OFF", "-DGLFW_BUILD_EXAMPLES=OFF", "-DGLFW_INSTALL=OFF"); - 'ASSIMP' = @("-DASSIMP_BUILD_TESTS=OFF", "-DASSIMP_INSTALL=OFF", "-DASSIMP_BUILD_SAMPLES=OFF", "-DASSIMP_BUILD_ASSIMP_TOOLS=OFF", "-DASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT=OFF", "-DASSIMP_BUILD_OBJ_IMPORTER=ON", "-DASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT=OFF", "-DASSIMP_BUILD_OBJ_EXPORTER=ON"); - 'STDUUID' = @("-DUUID_BUILD_TESTS=OFF", "-DUUID_USING_CXX20_SPAN=ON", "-DUUID_SYSTEM_GENERATOR=OFF"); - 'YAMLCPP' = @("-DYAML_CPP_BUILD_TOOLS=OFF", "-DYAML_CPP_BUILD_TESTS=OFF", "-DYAML_CPP_FORMAT_SOURCE=OFF", "-DYAML_BUILD_SHARED_LIBS=OFF"); - 'FRAMEWORK' = @("-DBUILD_FRAMEWORK=ON"); - 'VULKAN_LOADER' = @("-DVULKAN_HEADERS_INSTALL_DIR=$ExternalVulkanHeadersInstallDir", "-DUSE_MASM=OFF", "-DUSE_GAS=OFF") - 'SPIRV_TOOLS' = @("-DSPIRV_SKIP_EXECUTABLES=ON", "-DSPIRV_SKIP_TESTS=ON") - 'SPIRV_CROSS' = @("-DSPIRV_CROSS_ENABLE_TESTS=OFF") - 'LAUNCHER_ONLY' = @("-DLAUNCHER_ONLY=ON") - 'GLM' = @("-DCMAKE_POLICY_VERSION_MINIMUM=3.5") - } - - $cMakeCacheVariableOverride = $cMakeOptions -join ' ' - # Define CMake Generator argument switch ($systemName) { "Windows" { @@ -170,38 +130,9 @@ 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' - } - "Darwin" { - $cMakeGenerator = "-G `"Xcode`"" - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.FRAMEWORK -join ' ' - } - Default { - throw 'This system is not supported' - } - } - - if($LauncherOnly) { - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.LAUNCHER_ONLY -join ' ' - } else { - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.ENT -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.SPDLOG -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.ASSIMP -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.STDUUID -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.YAMLCPP -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.VULKAN_LOADER -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.SPIRV_CROSS -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.SPIRV_TOOLS -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.GLFW -join ' ' - $cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.GLM -join ' ' } - $cMakeArguments = " -S $repositoryRootPath -B $buildDirectoryPath $cMakeGenerator $cMakeCacheVariableOverride" + $cMakeArguments = " -S $repositoryRootPath -B $buildDirectoryPath $cMakeGenerator $cMakeCacheVariableOverride -DCMAKE_BUILD_TYPE=$configuration" # CMake Generation process Write-Host $cMakeArguments @@ -220,7 +151,7 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) { $buildToolOptions = '-nodeReuse:false' } - $buildArguments = "--build $buildDirectoryPath --config $configuration" + $buildArguments = "--build $buildDirectoryPath" if ($buildToolOptions) { $buildArguments = $buildArguments, $buildToolOptions -join " --" } @@ -232,11 +163,11 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) { # https://stackoverflow.com/questions/44057728/start-process-system-diagnostics-process-exitcode-is-null-with-nonewwindow $processHandle = $buildProcess.Handle $buildProcess.WaitForExit(); - if ($buildProcess.ExitCode -ne 0) { - throw "cmake failed build for '$buildArguments' with exit code '$buildProcess.ExitCode'" - } + #if ($buildProcess.ExitCode -ne 0) { + # throw "cmake failed build for '$buildArguments' with exit code '$buildProcess.ExitCode'" + #} } -} + if(-Not $LauncherOnly) { @@ -258,9 +189,9 @@ if(-Not $LauncherOnly) { } } } +} - - # Run Shader Compilation +# Run Shader Compilation foreach ($config in $Configurations) { $shaderCompileScript = Join-Path $PSScriptRoot -ChildPath "ShaderCompile.ps1" & pwsh -File $shaderCompileScript -Configuration:$config -ForceRebuild:$true diff --git a/Scripts/ClangFormat.ps1 b/Scripts/ClangFormat.ps1 index 626b26b8..2385efd6 100644 --- a/Scripts/ClangFormat.ps1 +++ b/Scripts/ClangFormat.ps1 @@ -45,7 +45,7 @@ $srcFiles = $srcFiles | ForEach-Object { $_.FullName } Write-Host "Running clang-format on $SourceDirectory..." -[string[]] $clangFormatArgument = "-i", "--ferror-limit=0", "-fallback-style=none", "--style=file" +[string[]] $clangFormatArgument = "-i", "--ferror-limit=0", "-fallback-style=Microsoft", "--style=file" if ($RunAsCheck) { $clangFormatArgument += "--dry-run", "--Werror" @@ -59,8 +59,8 @@ $process.WaitForExit() $exitCode = $process.ExitCode if ($exitCode -ne 0) { - Write-Error "clang-format failed formatting source with exit code '$exitCode'" -ErrorAction Stop + Write-Error "clang-format failed formatting source with exit code '$exitCode'" } else { Write-Host "clang-format source formatting succeeded" -} \ No newline at end of file +} diff --git a/Scripts/RunTests.ps1 b/Scripts/RunTests.ps1 index 18528e54..2f7dcaa8 100644 --- a/Scripts/RunTests.ps1 +++ b/Scripts/RunTests.ps1 @@ -65,9 +65,11 @@ function RunTests { $testExecutablePath = [IO.Path]::Combine($OutputBuildDirectory, "ZEngine", "tests", $Configuration, "ZEngineTests.exe") } "Darwin" { - $testExecutablePath = Join-Path $OutputBuildDirectory -ChildPath "ZEngine/tests/$Configuration/ZEngineTests" + $testExecutablePath = Join-Path $OutputBuildDirectory -ChildPath "ZEngine/tests/ZEngineTests" } - "Linux" {} + "Linux" { + $testExecutablePath = Join-Path $OutputBuildDirectory -ChildPath "ZEngine/tests/ZEngineTests" + } Default { throw 'This system is not supported' } diff --git a/Scripts/Shared.ps1 b/Scripts/Shared.ps1 index 4364db64..4285e1b2 100644 --- a/Scripts/Shared.ps1 +++ b/Scripts/Shared.ps1 @@ -185,8 +185,6 @@ function Find-GlslangValidator () { function Find-ClangFormat () { $repoConfiguration = Get-RepositoryConfiguration - $LLVMMinimumVersion = $repoConfiguration.Requirements.LLVM.Version - $LLVMMaximumVersion = $repoConfiguration.Requirements.LLVM.MaximumVersion $candidates = @( 'clang-format' @@ -204,17 +202,18 @@ function Find-ClangFormat () { if ($clangFormatCommand) { if ((& $clangFormatCommand --version | Out-String) -match "clang-format version ([\d\.]*)") { [Version] $clangFormatVersion = $Matches[1] - if ((CompareVersion $clangFormatVersion $LLVMMinimumVersion) -and (CompareVersion $LLVMMaximumVersion $clangFormatVersion)) { return $clangFormatCommand.Source - } } } } - throw "Failed to find clang-format min $LLVMMinimumVersion max $LLVMMaximumVersion. Tried: " + ($candidates -join ', ') + throw "Failed to find clang-format min $LLVMMinimumVersion. Tried: " + ($candidates -join ', ') } function Setup-ShaderCCompilerTool () { + if($IsLinux) { + return + } $repoConfiguration = Get-RepositoryConfiguration $repositoryToolPath = $repoConfiguration.Paths.Tools diff --git a/Tetragrama/CMakeLists.txt b/Tetragrama/CMakeLists.txt index e8e64d2b..f0d1d052 100644 --- a/Tetragrama/CMakeLists.txt +++ b/Tetragrama/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required (VERSION 3.17) - project (Tetragrama VERSION 1.0 DESCRIPTION "Tetragrama, the ZEngine Editor" @@ -22,7 +20,7 @@ else() add_executable (${TARGET_NAME}) endif() -target_sources(${TARGET_NAME} PUBLIC ${HEADER_FILES} ${CPP_FILES}) +target_sources(${TARGET_NAME} PUBLIC ${CPP_FILES}) # We set this debugger directory to find assets and resources file # after being copied to Debug and Release output directories @@ -31,8 +29,6 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") set_target_properties(${TARGET_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$(ProjectDir)$(Configuration)") endif () -include(${EXTERNAL_DIR}/externals.cmake) - target_include_directories (${TARGET_NAME} PRIVATE . @@ -46,7 +42,6 @@ target_include_directories (${TARGET_NAME} ./Importers ./Serializers ./Managers - ${ENLISTMENT_ROOT}/ZEngine ) target_precompile_headers(${TARGET_NAME} PRIVATE pch.h) @@ -62,4 +57,4 @@ target_link_libraries(${TARGET_NAME} PRIVATE imported::External_editorLibs ) -set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "zEngineEditor") \ No newline at end of file +set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "zEngineEditor") diff --git a/Tetragrama/pch.cpp b/Tetragrama/pch.cpp deleted file mode 100644 index 8781bfd8..00000000 --- a/Tetragrama/pch.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/Tetragrama/pch.h b/Tetragrama/pch.h deleted file mode 100644 index 0866703a..00000000 --- a/Tetragrama/pch.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/ZEngine/CMakeLists.txt b/ZEngine/CMakeLists.txt index 2abca89f..d78021ca 100644 --- a/ZEngine/CMakeLists.txt +++ b/ZEngine/CMakeLists.txt @@ -6,18 +6,5 @@ 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) \ No newline at end of file +add_subdirectory (tests) diff --git a/ZEngine/ZEngine/CMakeLists.txt b/ZEngine/ZEngine/CMakeLists.txt index 70dad617..ec6c2bbd 100644 --- a/ZEngine/ZEngine/CMakeLists.txt +++ b/ZEngine/ZEngine/CMakeLists.txt @@ -1,5 +1,3 @@ -include(${EXTERNAL_DIR}/externals.cmake) - file (GLOB_RECURSE HEADER_FILES_LIST CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.h) file (GLOB_RECURSE CPP_FILES_LIST CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) file (GLOB_RECURSE RESOURCE_FILES_LIST CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/../Resources/Shaders/*.*) @@ -9,17 +7,17 @@ source_group (TREE ${PROJECT_SOURCE_DIR}/../Resources PREFIX "Resources Files" F # ZEngine source files # -add_library (zEngineLib - STATIC - ${HEADER_FILES_LIST} + +add_library(zEngineLib STATIC) + +target_sources(zEngineLib + PUBLIC ${CPP_FILES_LIST} - ${RESOURCE_FILES_LIST} - ${EXTERNAL_DIR}/ImGuizmo/ImGuizmo.h - ${EXTERNAL_DIR}/ImGuizmo/ImGuizmo.cpp ) target_include_directories (zEngineLib PUBLIC + .. . ./Core ./Core/Maths @@ -51,12 +49,8 @@ target_include_directories (zEngineLib ./Windows/Layers ./Managers ./Serializers - ${EXTERNAL_DIR} - ${EXTERNAL_INCLUDE_DIRS} ) -target_precompile_headers(zEngineLib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/pch.h) - if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") target_compile_definitions (zEngineLib PUBLIC ENABLE_VULKAN_VALIDATION_LAYER) endif() @@ -68,7 +62,7 @@ target_compile_definitions (zEngineLib ) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - target_compile_definitions (zEngineLib PUBLIC VK_USE_PLATFORM_WIN32_KHR) + target_compile_definitions (zEngineLib PUBLIC VK_USE_PLATFORM_WIN32_KHR NOMINMAX) endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") @@ -79,4 +73,4 @@ target_link_libraries (zEngineLib PUBLIC imported::External_libs) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") target_link_libraries (zEngineLib PUBLIC imported::cppwinrt_headers WindowsApp.lib) -endif() \ No newline at end of file +endif() diff --git a/ZEngine/ZEngine/Core/CoroutineScheduler.h b/ZEngine/ZEngine/Core/CoroutineScheduler.h index 6ffa8952..bdcd4f1c 100644 --- a/ZEngine/ZEngine/Core/CoroutineScheduler.h +++ b/ZEngine/ZEngine/Core/CoroutineScheduler.h @@ -15,7 +15,7 @@ namespace ZEngine::Core ReadyCallback Ready = nullptr; ExecuteCallback Action = nullptr; - operator bool() noexcept + operator bool() noexcept { return (Ready && Action); } diff --git a/ZEngine/ZEngine/Logging/Logger.cpp b/ZEngine/ZEngine/Logging/Logger.cpp index f4fc2c75..65a3607d 100644 --- a/ZEngine/ZEngine/Logging/Logger.cpp +++ b/ZEngine/ZEngine/Logging/Logger.cpp @@ -66,7 +66,8 @@ namespace ZEngine::Logging auto handlers_view = handlers.view(); for (const auto& handler : handlers_view) { - handler.second(LogMessage{ + handler.second( + LogMessage{ .Color = {0.0f, 1.0f, 0.0f, 1.0f}, .Message = msg }); @@ -89,7 +90,8 @@ namespace ZEngine::Logging auto handlers_view = handlers.view(); for (const auto& handler : handlers_view) { - handler.second(LogMessage{ + handler.second( + LogMessage{ .Color = {0.5f, 0.5f, 0.5f, 1.0f}, .Message = msg }); @@ -112,7 +114,8 @@ namespace ZEngine::Logging auto handlers_view = handlers.view(); for (const auto& handler : handlers_view) { - handler.second(LogMessage{ + handler.second( + LogMessage{ .Color = {1.0f, 0.5f, 0.0f, 1.0f}, .Message = msg }); @@ -135,7 +138,8 @@ namespace ZEngine::Logging auto handlers_view = handlers.view(); for (const auto& handler : handlers_view) { - handler.second(LogMessage{ + handler.second( + LogMessage{ .Color = {1.0f, 0.0f, 0.0f, 1.0f}, .Message = msg }); @@ -158,7 +162,8 @@ namespace ZEngine::Logging auto handlers_view = handlers.view(); for (const auto& handler : handlers_view) { - handler.second(LogMessage{ + handler.second( + LogMessage{ .Color = {1.0f, 0.0f, 1.0f, 1.0f}, .Message = msg }); diff --git a/ZEngine/ZEngine/ZEngineDef.h b/ZEngine/ZEngine/ZEngineDef.h index 42fa76ed..49a162e1 100644 --- a/ZEngine/ZEngine/ZEngineDef.h +++ b/ZEngine/ZEngine/ZEngineDef.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #define BIT(x) (1 << (x)) #define ZENGINE_EXIT_FAILURE() exit(EXIT_FAILURE); @@ -12,7 +12,8 @@ #include #define ZENGINE_DEBUG_BREAK() __builtin_trap(); #else -#error "Platform not supported!" +#include +#define ZENGINE_DEBUG_BREAK() raise(SIGTRAP); #endif #ifdef _MSC_VER @@ -28,7 +29,7 @@ if (!(condition)) \ { \ ZENGINE_CORE_CRITICAL(message) \ - assert(condition&& message); \ + assert(condition && message); \ ZENGINE_DEBUG_BREAK() \ } \ } @@ -95,4 +96,4 @@ #define ASSET_FILE_VERSION MAKE_VERSION(1, 0, 0) #define SCENE_FILE_VERSION MAKE_VERSION(1, 0, 0) -typedef const char* cstring; \ No newline at end of file +typedef const char* cstring; diff --git a/ZEngine/ZEngine/pch.cpp b/ZEngine/ZEngine/pch.cpp deleted file mode 100644 index 8781bfd8..00000000 --- a/ZEngine/ZEngine/pch.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/__externals/CLI11 b/__externals/CLI11 deleted file mode 160000 index f75fd22b..00000000 --- a/__externals/CLI11 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f75fd22ba323bbb3b6621ed9beaf8f52f24796fd diff --git a/__externals/ImGuizmo b/__externals/ImGuizmo deleted file mode 160000 index e3174578..00000000 --- a/__externals/ImGuizmo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e3174578bdc99c715e51c5ad88e7d50b4eeb19b0 diff --git a/__externals/SPIRV-Cross b/__externals/SPIRV-Cross deleted file mode 160000 index 4818f7e7..00000000 --- a/__externals/SPIRV-Cross +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4818f7e7ef7b7078a3a7a5a52c4a338e0dda22f4 diff --git a/__externals/SPIRV-Tools b/__externals/SPIRV-Tools deleted file mode 160000 index dda7731e..00000000 --- a/__externals/SPIRV-Tools +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dda7731e91c130e64980d987a02f5c75356400cc diff --git a/__externals/SPIRV-headers b/__externals/SPIRV-headers deleted file mode 160000 index 7d500c4d..00000000 --- a/__externals/SPIRV-headers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7d500c4d75ae3fbd37e1d5a20008ca9c8ee3c860 diff --git a/__externals/Vulkan-Headers b/__externals/Vulkan-Headers deleted file mode 160000 index b379292b..00000000 --- a/__externals/Vulkan-Headers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b379292b2ab6df5771ba9870d53cf8b2c9295daf diff --git a/__externals/Vulkan-Loader b/__externals/Vulkan-Loader deleted file mode 160000 index 40b8e6ee..00000000 --- a/__externals/Vulkan-Loader +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 40b8e6eeead809a62c708cb48fdd9f8f2eab3f15 diff --git a/__externals/VulkanMemoryAllocator b/__externals/VulkanMemoryAllocator deleted file mode 160000 index 5e43c795..00000000 --- a/__externals/VulkanMemoryAllocator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5e43c795daf43dd09398d8307212e85025215052 diff --git a/__externals/assimp b/__externals/assimp deleted file mode 160000 index 70f5cca9..00000000 --- a/__externals/assimp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 70f5cca9c3ebd84b89c5775852ac9aa2449f6c5b diff --git a/__externals/entt b/__externals/entt deleted file mode 160000 index 41aab920..00000000 --- a/__externals/entt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 41aab920b083aa424ac1d27666ce287eeaff6ceb diff --git a/__externals/externals.cmake b/__externals/externals.cmake deleted file mode 100644 index 35f6d663..00000000 --- a/__externals/externals.cmake +++ /dev/null @@ -1,60 +0,0 @@ -# Packages -# -set(EXTERNAL_INCLUDE_DIRS - ${EXTERNAL_DIR}/Vulkan-Headers/build/install/include - ${EXTERNAL_DIR}/fmt/include - ${EXTERNAL_DIR}/glm/glm - ${EXTERNAL_DIR}/imgui/src - ${EXTERNAL_DIR}/tlsf/src - ${EXTERNAL_DIR}/rapidhash/src - ${EXTERNAL_DIR}/spdlog/include - ${EXTERNAL_DIR}/glfw/include - ${EXTERNAL_DIR}/entt - ${EXTERNAL_DIR}/assimp/include - ${EXTERNAL_DIR}/stduuid/include - ${EXTERNAL_DIR}/yaml-cpp/include - ${EXTERNAL_DIR}/SPIRV-headers - ${EXTERNAL_DIR}/SPIRV-Tools - ${EXTERNAL_DIR}/glslang - ${EXTERNAL_DIR}/SPIRV-Cross - ${EXTERNAL_DIR}/VulkanMemoryAllocator - ${EXTERNAL_DIR}/nlohmann_json/single_include - ${EXTERNAL_DIR}/CLI11/include -) - -if (MSVC) - target_compile_options(assimp PRIVATE /Wv:18) # Fix zip lib compile issue -elseif(APPLE) - target_compile_options(assimp PRIVATE -Wno-shorten-64-to-32 -Wno-unused-but-set-variable -Wno-deprecated-declarations) -endif() - -if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - target_link_libraries(imgui PUBLIC ${CMAKE_DL_LIBS}) -endif() - -add_library (imported::External_libs INTERFACE IMPORTED) -add_library(imported::External_editorLibs INTERFACE IMPORTED) - - -target_link_libraries(imported::External_editorLibs INTERFACE - CLI11::CLI11 -) - -target_link_libraries(imported::External_libs INTERFACE - vulkan - fmt - glm - imgui - spdlog - glfw - EnTT - assimp - stduuid - yaml-cpp - spirv-cross-reflect spirv-cross-glsl - GPUOpen::VulkanMemoryAllocator - glslang SPIRV - SPIRV-Tools - tlsf - rapidhash -) diff --git a/__externals/fmt b/__externals/fmt deleted file mode 160000 index e41ac1f8..00000000 --- a/__externals/fmt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e41ac1f875b7a1c419beaf7ddf431a01fb530a92 diff --git a/__externals/glfw b/__externals/glfw deleted file mode 160000 index fb0f2f92..00000000 --- a/__externals/glfw +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fb0f2f92a38c1d6a776ffeb253329f8d1c65694c diff --git a/__externals/glm b/__externals/glm deleted file mode 160000 index 84f2045a..00000000 --- a/__externals/glm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 84f2045a79a4aa2454801a98e2de0401bd9c8aee diff --git a/__externals/glslang b/__externals/glslang deleted file mode 160000 index 32257786..00000000 --- a/__externals/glslang +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3225778615fd9d7e23fd11b71a05097d59ba0247 diff --git a/__externals/gtest b/__externals/gtest deleted file mode 160000 index b10fad38..00000000 --- a/__externals/gtest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b10fad38c4026a29ea6561ab15fc4818170d1c10 diff --git a/__externals/imgui/CMakeLists.txt b/__externals/imgui/CMakeLists.txt deleted file mode 100644 index 4b1e0f25..00000000 --- a/__externals/imgui/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -set(CMAKE_CXX_STANDARD 11) - -list (APPEND IMGUI_SOURCE - src/imgui.h - src/imgui_internal.h - src/imgui.cpp - src/imgui_tables.cpp - src/imgui_widgets.cpp - src/imgui_demo.cpp - src/imgui_draw.cpp - src/backends/imgui_impl_vulkan.cpp - src/backends/imgui_impl_glfw.cpp -) - -# Source files -# -add_library (imgui STATIC ${IMGUI_SOURCE}) - -# include directories -# -target_include_directories (imgui - PUBLIC - ./src - ./src/backends - ${EXTERNAL_DIR}/glfw/include - PRIVATE - ${EXTERNAL_DIR}/Vulkan-Headers/build/install/include -) - diff --git a/__externals/imgui/src b/__externals/imgui/src deleted file mode 160000 index c191faf0..00000000 --- a/__externals/imgui/src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c191faf0ba478e9c58a69c63306986a21ebfb6e4 diff --git a/__externals/nlohmann_json b/__externals/nlohmann_json deleted file mode 160000 index 0457de21..00000000 --- a/__externals/nlohmann_json +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0457de21cffb298c22b629e538036bfeb96130b7 diff --git a/__externals/rapidhash/CMakeLists.txt b/__externals/rapidhash/CMakeLists.txt deleted file mode 100644 index 44218ca0..00000000 --- a/__externals/rapidhash/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.12) -project(rapidhash) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -add_library(rapidhash INTERFACE) - -target_include_directories(rapidhash INTERFACE - $ -) diff --git a/__externals/rapidhash/src b/__externals/rapidhash/src deleted file mode 160000 index c1f35e3a..00000000 --- a/__externals/rapidhash/src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c1f35e3a44010bf90a9008013d8ab7c7b9aaae2c diff --git a/__externals/spdlog b/__externals/spdlog deleted file mode 160000 index 6491abb5..00000000 --- a/__externals/spdlog +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6491abb519a6a15792c1c6717270ce6c9ba4d72e diff --git a/__externals/stb b/__externals/stb deleted file mode 160000 index 8e51be04..00000000 --- a/__externals/stb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8e51be04dc7dcee462e1f09e410faceab52cc6d2 diff --git a/__externals/stduuid b/__externals/stduuid deleted file mode 160000 index 5c538cca..00000000 --- a/__externals/stduuid +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5c538cca02932aa0266659661d5b4726f3a317c7 diff --git a/__externals/tlsf/CMakeLists.txt b/__externals/tlsf/CMakeLists.txt deleted file mode 100644 index 2ea24439..00000000 --- a/__externals/tlsf/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(CMAKE_CXX_STANDARD 11) - -list (APPEND TLSF_SOURCE - src/tlsf.h - src/tlsf.c -) - -# Source files -# -add_library (tlsf STATIC ${TLSF_SOURCE}) - -# include directories -# -target_include_directories (tlsf - PUBLIC - ./src -) - diff --git a/__externals/tlsf/src b/__externals/tlsf/src deleted file mode 160000 index deff9ab5..00000000 --- a/__externals/tlsf/src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit deff9ab509341f264addbd3c8ada533678591905 diff --git a/__externals/yaml-cpp b/__externals/yaml-cpp deleted file mode 160000 index c73ee347..00000000 --- a/__externals/yaml-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c73ee34704c512ebe915b283645aefa9f424a22f diff --git a/dependencies.cmake b/dependencies.cmake index 9f729772..14239d22 100644 --- a/dependencies.cmake +++ b/dependencies.cmake @@ -1,3 +1,324 @@ +include(FetchContent) + +#externalpackagesettings + +#ENTT +set(ENTT_INCLUDE_HEADERS=ON) + +#SPDLOG +set(SPDLOG_BUILD_SHARED=OFF) +set(BUILD_STATIC_LIBS=ON) +set(SPDLOG_FMT_EXTERNAL=ON) +set(SPDLOG_FMT_EXTERNAL_HO=OFF) + +#GLFW +set(GLFW_BUILD_DOCS=OFF) +set(GLFW_BUILD_EXAMPLES=OFF) +set(GLFW_INSTALL=OFF) + +#ASSIMP +set(ASSIMP_BUILD_TESTS=OFF) +set(ASSIMP_INSTALL=OFF) +set(ASSIMP_BUILD_SAMPLES=OFF) +set(ASSIMP_BUILD_ASSIMP_TOOLS=OFF) +set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT=OFF) +set(ASSIMP_BUILD_OBJ_IMPORTER=ON) +set(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT=OFF) +set(ASSIMP_BUILD_OBJ_EXPORTER=ON) + +#STDUUID +set(UUID_BUILD_TESTS=OFF) +set(UUID_USING_CXX20_SPAN=ON) +set(UUID_SYSTEM_GENERATOR=OFF) + +#YAMLCPP +set(YAML_CPP_BUILD_TOOLS=OFF) +set(YAML_CPP_BUILD_TESTS=OFF) +set(YAML_CPP_FORMAT_SOURCE=OFF) +set(YAML_BUILD_SHARED_LIBS=OFF) + +#VULKAN_LOADER +set(USE_MASM=OFF) +set(USE_GAS=OFF) + +#GLSLANG +set(ALLOW_EXTERNAL_SPIRV_TOOLS=ON) + +#SPIRV_TOOLS +set(SPIRV_SKIP_EXECUTABLES=ON) +set(SPIRV_SKIP_TESTS=ON) +set(ENABLE_OPT=OFF) + +#SPIRV_CROSS +set(SPIRV_CROSS_ENABLE_TESTS=OFF) + +#GLM +set(CMAKE_POLICY_VERSION_MINIMUM=3.5) + +FetchContent_Declare( + fmt + GIT_REPOSITORY https://github.com/fmtlib/fmt.git + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + imgui + GIT_REPOSITORY https://github.com/ocornut/imgui.git + GIT_SHALLOW TRUE + GIT_TAG v1.89.9-docking + ) + +FetchContent_Declare( + imguizmo + GIT_REPOSITORY https://github.com/CedricGuillemet/ImGuizmo.git + GIT_SHALLOW TRUE + GIT_TAG 1.83 + ) + +FetchContent_Declare( + stbimage + GIT_REPOSITORY https://github.com/nothings/stb.git + SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/stb + GIT_SHALLOW TRUE) + +FetchContent_Declare( + glfw3 + GIT_REPOSITORY https://github.com/glfw/glfw.git + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + spdlog + GIT_REPOSITORY https://github.com/gabime/spdlog.git + GIT_SHALLOW TRUE + GIT_TAG v1.15.3 + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + glm + GIT_REPOSITORY https://github.com/g-truc/glm.git + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + EnTT + GIT_REPOSITORY https://github.com/skypjack/entt.git + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + assimp + GIT_REPOSITORY https://github.com/assimp/assimp.git + GIT_TAG v5.3.0 + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + stduuid + GIT_REPOSITORY https://github.com/mariusbancila/stduuid.git + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + yaml-cpp + GIT_REPOSITORY https://github.com/jbeder/yaml-cpp + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + + +FetchContent_Declare( + spirv_cross_core + GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Cross.git + GIT_TAG main + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + VulkanMemoryAllocator + GIT_REPOSITORY + https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS + ) + +FetchContent_Declare( + SPIRV-Headers + GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Headers.git + GIT_SHALLOW TRUE + GIT_TAG main + FIND_PACKAGE_ARGS +) + +FetchContent_Declare( + glslang + GIT_REPOSITORY https://github.com/KhronosGroup/glslang.git + GIT_SHALLOW TRUE + GIT_TAG main-tot + SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/glslang" + FIND_PACKAGE_ARGS +) + + +FetchContent_Declare( + SPIRV-Tools + GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Tools.git + GIT_SHALLOW TRUE + GIT_TAG main + FIND_PACKAGE_ARGS +) + + +Fetchcontent_Declare( + GTest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_SHALLOW TRUE + GIT_TAG main + FIND_PACKAGE_ARGS +) + +Fetchcontent_Declare( + nlohmann_json + GIT_REPOSITORY https://github.com/nlohmann/json.git + GIT_SHALLOW TRUE + FIND_PACKAGE_ARGS +) + +Fetchcontent_Declare( + tlsf + GIT_REPOSITORY https://github.com/mattconte/tlsf + GIT_SHALLOW TRUE + SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/tlsf + FIND_PACKAGE_ARGS +) + +Fetchcontent_Declare( + CLI11 + GIT_REPOSITORY https://github.com/CLIUtils/CLI11 + GIT_SHALLOW TRUE + GIT_TAG main + SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/CLI11 + FIND_PACKAGE_ARGS +) + + +Fetchcontent_Declare( + rapidhash + GIT_REPOSITORY https://github.com/Nicoshev/rapidhash + GIT_SHALLOW TRUE + SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/rapidhash + FIND_PACKAGE_ARGS +) + + +FetchContent_MakeAvailable( + fmt + imgui + ImGuizmo + stbimage + glfw3 + spdlog + glm + EnTT + assimp + stduuid + yaml-cpp + spirv_cross_core + VulkanMemoryAllocator + SPIRV-Headers + SPIRV-Tools + glslang + GTest + nlohmann_json + tlsf + CLI11 + rapidhash + ) + +find_package(Vulkan REQUIRED) + +set(IMGUIDIR ${FETCHCONTENT_BASE_DIR}/imgui-src) + +add_library(imgui STATIC) + +target_sources( + imgui + PRIVATE ${IMGUIDIR}/imgui.cpp + ${IMGUIDIR}/imgui_demo.cpp + ${IMGUIDIR}/imgui_draw.cpp + ${IMGUIDIR}/imgui_tables.cpp + ${IMGUIDIR}/imgui_widgets.cpp + ${IMGUIDIR}/misc/cpp/imgui_stdlib.cpp + ${IMGUIDIR}/backends/imgui_impl_glfw.cpp + ${IMGUIDIR}/backends/imgui_impl_vulkan.cpp) + +target_include_directories(imgui PUBLIC ${IMGUIDIR}) + +target_compile_definitions(imgui PUBLIC GLFW_INCLUDE_VULKAN IMGUI_DEFINE_MATH_OPERATORS) + +target_link_libraries(imgui PUBLIC glfw Vulkan::Vulkan) + +add_library(imguizmo STATIC) + +target_sources(imguizmo + PRIVATE ${FETCHCONTENT_BASE_DIR}/imguizmo-src/ImGuizmo.cpp) + +target_include_directories(imguizmo + PUBLIC ${FETCHCONTENT_BASE_DIR}/imguizmo-src) + +target_link_libraries(imguizmo PUBLIC imgui) + +add_library(External_libs INTERFACE) + +target_compile_definitions(External_libs INTERFACE GLM_ENABLE_EXPERIMENTAL) + +target_include_directories(External_libs + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${FETCHCONTENT_BASE_DIR} + ${FETCHCONTENT_BASE_DIR}/rapidhash + ${FETCHCONTENT_BASE_DIR}/stb + ${FETCHCONTENT_BASE_DIR}/CLI11 + ${FETCHCONTENT_BASE_DIR}/tlsf + ) + +target_link_libraries(External_libs + INTERFACE + fmt::fmt + glm::glm + imguizmo + spdlog::spdlog + EnTT::EnTT + assimp::assimp + stduuid + yaml-cpp::yaml-cpp + spirv-cross-core + SPIRV-Tools + glslang::glslang + glslang::glslang-default-resource-limits + glslang::SPIRV + glslang::SPVRemapper + GPUOpen::VulkanMemoryAllocator +) + +add_library(imported::External_libs ALIAS External_libs) + +add_library(External_editorLibs INTERFACE) +target_link_libraries(External_editorLibs + INTERFACE + nlohmann_json::nlohmann_json + CLI11::CLI11 +) +add_library(imported::External_editorLibs ALIAS External_editorLibs) + if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") # Install necessary NuGet dependencies install_nuget_package(Microsoft.Windows.CppWinRT 2.0.240405.15 CPPWINRT_NUGET_PATH) @@ -17,4 +338,4 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") target_include_directories(imported::cppwinrt_headers INTERFACE ${CMAKE_BINARY_DIR}/__winrt ) -endif() \ No newline at end of file +endif() diff --git a/repoConfiguration.json b/repoConfiguration.json index 390080bc..f0af7173 100644 --- a/repoConfiguration.json +++ b/repoConfiguration.json @@ -20,8 +20,8 @@ "Url": "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" }, "LLVM": { - "Version": "18.1.8", - "MaximumVersion": "18.2.1" + "Version": "20.1.7", + "MaximumVersion": "20.2.0" } } } \ No newline at end of file