Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
df64e43
Remove support for MacOS 11
Khrysys Oct 23, 2023
99cc9d0
Attempt dynamic linking
Khrysys Oct 25, 2023
685bd1b
(1/2) VMA Config
Khrysys Oct 25, 2023
bbab9e3
Added installing to core
Khrysys Oct 26, 2023
1b8ad32
Add Install scripts
Khrysys Oct 26, 2023
c5e21dd
Swapchain works (kind of)
Khrysys Oct 27, 2023
4ebf08e
Add some other submodules
Khrysys Oct 27, 2023
2616193
Potentially might have fixed it
Khrysys Nov 4, 2023
2132002
Update GH actions since SPIRV-Tools is required
Khrysys Nov 4, 2023
3f9f1eb
Update core
Khrysys Nov 4, 2023
49a1a0b
-fPIC needs to be in link options
Khrysys Nov 4, 2023
124c20c
Update Linux-based systems to try to fix the error with GLIBCXX_3.4.29
Khrysys Nov 4, 2023
caa311f
Try a different fix
Khrysys Nov 4, 2023
10fab09
Attempt with forced action Vk version
Khrysys Nov 4, 2023
5c8442a
Update to dynamically create string VkEnum functions
Khrysys Nov 5, 2023
4798460
I still don't know why the compile options fail
Khrysys Nov 5, 2023
2147e59
Slight issue with Wall
Khrysys Nov 5, 2023
b46ceae
Add custom action to add shaderc to the repo
Khrysys Nov 5, 2023
184e326
Has to be this way instead
Khrysys Nov 5, 2023
eb04d24
Forgot to change the name in the actual actions
Khrysys Nov 5, 2023
4d64031
Add shell naming to action run
Khrysys Nov 5, 2023
f8552ca
Fix action (again)
Khrysys Nov 5, 2023
7fdd051
Don't get dependencies in build_shaderc and add build action
Khrysys Nov 6, 2023
1f9479f
Add some useful arguments to get_shaderc
Khrysys Nov 6, 2023
c546bfd
add caching
Khrysys Nov 6, 2023
089560f
Use actions/checkout
Khrysys Nov 6, 2023
e3e54f0
Slight issues with get_shaderc
Khrysys Nov 6, 2023
30b9805
add shell
Khrysys Nov 6, 2023
c4b991c
Don't know why I set the skips to off
Khrysys Nov 6, 2023
7cbaae3
Rework everything again
Khrysys Nov 6, 2023
c3299de
forgor shell again
Khrysys Nov 6, 2023
465343d
Make paths absolute
Khrysys Nov 6, 2023
ca724f4
Ensure that there's no issues with the calver
Khrysys Nov 8, 2023
c4778f3
Last changes for break
Khrysys Dec 20, 2023
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
29 changes: 29 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build DragonEngine
description: Runs the commands to build DragonEngine from source and installs it

inputs:
type:
required: false
description: Whether or not to build shared libs
default: BUILD_SHARED_LIBS:BOOL=ON
config:
required: false
description: The CMake configuration to build (Debug, Release, MinSizeRel, or RelWithDebInfo)
default: Release
install_dir:
required: false
description: The directory to install this into
default: ${{github.workspace}}/install
build_dir:
required: false
description: The directory to build the files into
default: ${{github.workspace}}/build

runs:
using: 'composite'
steps:
- shell: bash
run: |
cmake . -B ${{ inputs.build_dir }} -D${{ inputs.type }} --install-prefix ${{ inputs.install_dir }} -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
cmake --build ${{ inputs.build_dir }} --config ${{ inputs.config }}
cmake --install ${{ inputs.build_dir }} --config ${{ inputs.config }}
16 changes: 16 additions & 0 deletions .github/actions/get_deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Get Dependencies

runs:
using: 'composite'

steps:
- if: runner.os == 'Linux'
shell: bash
run: sudo apt update && sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libc6-dev && export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH

- uses: humbletim/setup-vulkan-sdk@72eed4b9dbeac5de168f83da8e30b1d0f8ac7f14 # v1.2.0
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools
vulkan-use-cache: true

15 changes: 6 additions & 9 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
- run: sudo apt update && sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libc6-dev
- uses: humbletim/setup-vulkan-sdk@72eed4b9dbeac5de168f83da8e30b1d0f8ac7f14 # v1.2.0

- uses: ./.github/actions/get_deps

- uses: ./.github/actions/build
with:
vulkan-query-version: latest
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang
vulkan-use-cache: true
- run: |
cmake . -B build -D${{ matrix.type }} --install-prefix ${{ github.workspace }}/install -DCMAKE_INSTALL_DIR=${{ github.workspace }}/install -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
cmake --build ${{ github.workspace }}/build --config ${{ matrix.cfg }}
cmake --install ${{ github.workspace }}/build --config ${{ matrix.cfg }}
type: ${{ matrix.type }}
config: ${{ matrix.cfg }}
13 changes: 4 additions & 9 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,12 @@ jobs:
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
- uses: ./.github/actions/get_deps

- run: sudo apt update && sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libc6-dev
- uses: humbletim/setup-vulkan-sdk@72eed4b9dbeac5de168f83da8e30b1d0f8ac7f14 # v1.2.0
- uses: ./.github/actions/build
with:
vulkan-query-version: latest
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang
vulkan-use-cache: true
- run: |
cmake . -B build --install-prefix ${{ github.workspace }}/install -DCMAKE_INSTALL_DIR=${{ github.workspace }}/install -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
cmake --build ${{ github.workspace }}/build
cmake --install ${{ github.workspace }}/build
type: -DBUILD_SHARED_LIBS:BOOL=OFF
config: Release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: latest-stable

- uses: humbletim/setup-vulkan-sdk@72eed4b9dbeac5de168f83da8e30b1d0f8ac7f14 # v1.2.0
with:
vulkan-query-version: latest
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools
vulkan-use-cache: true
- run: |
cmake . -B build -D${{ matrix.type }} --install-prefix ${{ github.workspace }}/install -DCMAKE_INSTALL_DIR=${{ github.workspace }}/install -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
cmake --build ${{ github.workspace }}/build --config ${{ matrix.cfg }}
cmake --install ${{ github.workspace }}/build --config ${{ matrix.cfg }}

- uses: ./.github/actions/get_deps

- uses: ./.github/actions/build
with:
type: ${{ matrix.type }}
config: ${{ matrix.cfg }}
17 changes: 8 additions & 9 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
- run: sudo apt update && sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libc6-dev
- uses: humbletim/setup-vulkan-sdk@72eed4b9dbeac5de168f83da8e30b1d0f8ac7f14 # v1.2.0

- run: sudo apt update && sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libc6-dev && export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH

- uses: ./.github/actions/get_deps

- uses: ./.github/actions/build
with:
vulkan-query-version: latest
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang
vulkan-use-cache: true
- run: |
cmake . -B build -D${{ matrix.type }} --install-prefix ${{ github.workspace }}/install -DCMAKE_INSTALL_DIR=${{ github.workspace }}/install -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
cmake --build ${{ github.workspace }}/build --config ${{ matrix.cfg }}
cmake --install ${{ github.workspace }}/build --config ${{ matrix.cfg }}
type: ${{ matrix.type }}
config: ${{ matrix.cfg }}
16 changes: 7 additions & 9 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
os: [13, 12, 11]
os: [12, 13]
type: [ BUILD_SHARED_LIBS=OFF, BUILD_SHARED_LIBS=ON ]
cfg: [ Debug, Release ]

Expand All @@ -33,12 +33,10 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
- uses: humbletim/setup-vulkan-sdk@72eed4b9dbeac5de168f83da8e30b1d0f8ac7f14 # v1.2.0

- uses: ./.github/actions/get_deps

- uses: ./.github/actions/build
with:
vulkan-query-version: latest
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang
vulkan-use-cache: true
- run: |
cmake . -B build -D${{ matrix.type }} --install-prefix ${{ github.workspace }}/install -DCMAKE_INSTALL_DIR=${{ github.workspace }}/install -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
cmake --build ${{ github.workspace }}/build --config ${{ matrix.cfg }}
cmake --install ${{ github.workspace }}/build --config ${{ matrix.cfg }}
type: ${{ matrix.type }}
config: ${{ matrix.cfg }}
17 changes: 9 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
- uses: humbletim/setup-vulkan-sdk@72eed4b9dbeac5de168f83da8e30b1d0f8ac7f14 # v1.2.0

- uses: ./.github/actions/get_deps
with:
install_dir: ${{github.workspace}}\install
build_dir: ${{github.workspace}}\build

- uses: ./.github/actions/build
with:
vulkan-query-version: latest
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang
vulkan-use-cache: true
- run: |
cmake . -B build -D${{ matrix.type }} --install-prefix ${{ github.workspace }}/install -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
cmake --build ${{ github.workspace }}/build --config ${{ matrix.cfg }}
cmake --install ${{ github.workspace }}/build --config ${{ matrix.cfg }}
type: ${{ matrix.type }}
config: ${{ matrix.cfg }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ compile_commands.json
CTestTestfile.cmake
_deps
build/
!.github/actions/build/
.vscode/
.vs/
.DS_Store
.DS_Store
install/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@
[submodule "docs"]
path = docs
url = ../DragonDocs
[submodule "modules/particle"]
path = modules/particle
url = ../DragonParticle
[submodule "modules/raytrace"]
path = modules/raytrace
url = ../DragonRaytrace
126 changes: 89 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
cmake_minimum_required(VERSION 3.24)

# Vulkan package call has to be separated out since either GLSLC or glslangValidator
# will fufill the shader requirement of the compute engine and the graphics engine
find_package(Vulkan REQUIRED)
find_package(Vulkan COMPONENTS glslc glslangValidator)
find_package(Vulkan REQUIRED OPTIONAL_COMPONENTS glslc glslangValidator)
find_package(Python3 REQUIRED COMPONENTS Interpreter)

# Check if the CMP0077 policy is set and if not, set it to NEW
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)

string(TIMESTAMP maj "%Y")
math(EXPR maj ${maj})
string(TIMESTAMP min "%m")
math(EXPR min ${min})
string(TIMESTAMP rev "%d")
math(EXPR rev ${rev})

project(DragonEngine VERSION ${maj}.${min}.${rev}.0)
set(Dragon_FOUND CACHE BOOL "" ON)

if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(FMT_MASTER_PROJECT ON)
set(DragonEngine_MASTER_PROJECT CACHE BOOL ON)
message(STATUS "CMake version: ${CMAKE_VERSION}")
endif ()

Expand All @@ -27,58 +28,113 @@ if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
message(STATUS "Build started for ${PROJECT_NAME} Version ${PROJECT_VERSION}")
endif()

option(Dragon_INSTALL "Toggle to optionally configure the install files for DragonEngine" OFF)
option(Dragon_PACKAGE_BUILD "Toggle to optionally configure the CPack generator files" OFF)
option(Dragon_INSTALL "Toggle to optionally configure the install files for DragonEngine" ON)
option(Dragon_INSTALL_SOURCE "Toggle to optionally install the C++ source files for DragonEngine" ${DragonEngine_MASTER_PROJECT})
option(Dragon_PACKAGE_BUILD "Toggle to optionally configure the CPack generator files" ON)
option(Dragon_BUILD_EXAMPLES "Toggle to optionally build all the examples (dginfo is always built)" ON)
option(Dragon_BUILD_TESTS "Toggle to optionally not build the tests for DragonEngine" OFF)
option(Dragon_BUILD_DOCS "Toggle to optionally build the documentation (has no effect without Doxygen)" OFF)
option(Dragon_BUILD_TESTS "Toggle to optionally not build the tests for DragonEngine" ON)
option(Dragon_BUILD_DOCS "Toggle to optionally build the documentation (has no effect without Doxygen)" ON)
option(Dragon_BUILD_DEPENDENCY_DOCS "Toggle to optionally build the documentation for Dragon's source dependencies (VkBootstrap, VMA, etc.)" OFF)
option(Dragon_NO_VULKAN "Toggle to build DragonEngine without any Vulkan or VMA support" OFF)

message(CHECK_START "Finding Dragon Submodules")
unset(missingComponents)

message(CHECK_START "Finding Dragon::Audio")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/audio/CMakeLists.txt)
set(DragonAudio_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/audio)
else()
find_package(DragonEngine COMPONENTS Audio QUIET)
if(DragonAudio_FOUND)
message(CHECK_PASS "found binaries")
else()
message(CHECK_FAIL "not found")
endif()
endif()

message(CHECK_START "Finding Dragon::Compute")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/compute/CMakeLists.txt)
set(DragonCompute_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/compute)
else()
find_package(DragonEngine COMPONENTS Compute QUIET)
if(DragonCompute_FOUND)
message(CHECK_PASS "found binaries")
else()
message(CHECK_FAIL "not found")
endif()
endif()

message(CHECK_START "Finding Dragon::Core")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/core/CMakeLists.txt)
set(DragonCore_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/core)
else()
find_package(DragonCore)
find_package(DragonEngine COMPONENTS Core QUIET)
if(DragonCore_FOUND)
message(CHECK_PASS "found binaries")
else()
message(CHECK_FAIL "not found")
endif()
endif()

if(DragonCore_FOUND)
message(CHECK_START "Finding Dragon::Graphics")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/graphics/CMakeLists.txt)
set(DragonGraphics_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/graphics)
message(CHECK_START "Finding Dragon::Graphics")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/graphics/CMakeLists.txt)
set(DragonGraphics_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/graphics)
else()
find_package(DragonEngine COMPONENTS Graphics QUIET)
if(DragonGraphics_FOUND)
message(CHECK_PASS "found binaries")
else()
message(CHECK_FAIL "not found")
endif()
endif()

message(CHECK_START "Finding Dragon::Particle")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/particle/CMakeLists.txt)
set(DragonParticle_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/particle)
else()
find_package(DragonEngine COMPONENTS Particle QUIET)
if(DragonParticle_FOUND)
message(CHECK_PASS "found binaries")
else()
find_package(DragonGraphics)
if(DragonGraphics_FOUND)
message(CHECK_PASS "found binaries")
else()
message(CHECK_FAIL "not found")
endif()
message(CHECK_FAIL "not found")
endif()
endif()

message(CHECK_START "Finding Dragon::Compute")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/compute/CMakeLists.txt)
set(DragonCompute_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/compute)
message(CHECK_START "Finding Dragon::Physics")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/physics/CMakeLists.txt)
set(DragonPhysics_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/physics)
else()
find_package(DragonEngine COMPONENTS Physics QUIET)
if(DragonPhysics_FOUND)
message(CHECK_PASS "found binaries")
else()
find_package(DragonCompute)
if(DragonCompute_FOUND)
message(CHECK_PASS "found binaries")
else()
message(CHECK_FAIL "not found")
endif()
message(CHECK_FAIL "not found")
endif()
endif()

message(CHECK_START "Finding Dragon::Raytrace")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/modules/raytrace/CMakeLists.txt)
set(DragonRaytrace_FOUND CACHE BOOL "" ON)
message(CHECK_PASS "found sources")
add_subdirectory(modules/raytrace)
else()
find_package(DragonEngine COMPONENTS Raytrace QUIET)
if(DragonRaytrace_FOUND)
message(CHECK_PASS "found binaries")
else()
message(CHECK_FAIL "not found")
endif()
endif()

Expand All @@ -102,9 +158,5 @@ if(Dragon_BUILD_DOCS)
endif()

if(Dragon_INSTALL)
include(GNUInstallDirs)
include(cmake/install.cmake)
if(Dragon_PACKAGE_BUILD)
include(cmake/package.cmake)
endif()
endif()
Loading