Skip to content

Commit e2a1356

Browse files
add fetch_content + Vcpkg based config
add fetchcontent for entire project add VcPkg Binary Cache for windows
1 parent 47cadfe commit e2a1356

8 files changed

Lines changed: 78 additions & 85 deletions

File tree

.github/workflows/Engine-CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ master, develop, arena-integration, compile_on_linux_fetchcontent ]
3+
branches: [ master, develop, arena-integration, vcpkg_binary_cache ]
44
pull_request:
55
branches: [ master, develop, arena-integration ]
66

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ name: Windows Build Workflow
55
permissions:
66
packages: write
77

8+
env:
9+
USERNAME: mathewbensoncode
10+
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
11+
FEED_URL: https://nuget.pkg.github.com/mathewbensoncode/index.json
12+
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/mathewbensoncode/index.json,readwrite"
13+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
14+
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
15+
816
on:
917
workflow_call:
1018
inputs:
@@ -26,6 +34,28 @@ jobs:
2634
- name: update llvm to version 22
2735
run: choco upgrade llvm
2836

37+
- name: Install vcpkg
38+
shell: pwsh
39+
run: git clone --depth=1 https://github.com/Microsoft/vcpkg ${{github.workspace}}/vcpkg
40+
41+
- name: Bootstrap vcpkg
42+
shell: pwsh
43+
run: ${{ github.workspace }}/vcpkg/bootstrap-vcpkg.bat
44+
45+
- name: Add NuGet sources
46+
shell: pwsh
47+
run: |
48+
.$(${{ env.VCPKG_EXE }} fetch nuget) `
49+
sources add `
50+
-Source "${{ env.FEED_URL }}" `
51+
-StorePasswordInClearText `
52+
-Name GitHubPackages `
53+
-UserName "${{ env.USERNAME }}" `
54+
-Password "${{ secrets.GITHUB_TOKEN }}"
55+
.$(${{ env.VCPKG_EXE }} fetch nuget) `
56+
setapikey "${{ secrets.GITHUB_TOKEN }}" `
57+
-Source "${{ env.FEED_URL }}"
58+
2959
- name: CMake Build
3060
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
3161
shell: pwsh

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,3 +428,6 @@ CMakeSettings.json
428428

429429
# MacOS files
430430
.DS_Store
431+
432+
# Vcpkg Install Directory
433+
vcpkg_installed/

CMakePresets.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
"SPDLOG_FMT_EXTERNAL": "ON",
2525
"SPDLOG_FMT_EXTERNAL_HO": "OFF",
2626

27-
"GLFW_BUILD_DOCS": "OFF",
28-
"GLFW_BUILD_EXAMPLES": "OFF",
29-
30-
"ASSIMP_BUILD_TESTS": "OFF",
27+
"GLFW_BUILD_DOCS": "OFF", "GLFW_BUILD_EXAMPLES": "OFF", "ASSIMP_BUILD_TESTS": "OFF",
3128
"ASSIMP_INSTALL": "OFF",
3229
"ASSIMP_BUILD_SAMPLES": "OFF",
3330
"ASSIMP_BUILD_ASSIMP_TOOLS": "OFF",
@@ -52,8 +49,7 @@
5249
"GLSLANG_ENABLE_INSTALL": "ON",
5350
"ALLOW_EXTERNAL_SPIRV_TOOLS": "ON",
5451

55-
"SPIRV_CROSS_ENABLE_TESTS": "OFF",
56-
"CMAKE_POLICY_VERSION_MINIMUM": "3.5"
52+
"SPIRV_CROSS_ENABLE_TESTS": "OFF"
5753
}
5854
},
5955
{

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.

dependencies.cmake

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,62 @@ FetchContent_Declare(
66
GIT_SHALLOW TRUE
77
GIT_TAG main
88
FIND_PACKAGE_ARGS CONFIG
9-
)
9+
)
1010

1111
FetchContent_Declare(
1212
imgui
1313
GIT_REPOSITORY https://github.com/ocornut/imgui.git
1414
GIT_SHALLOW TRUE
1515
GIT_TAG v1.89.9-docking
1616
SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/imgui"
17-
)
17+
)
1818

1919
FetchContent_Declare(
2020
imguizmo
2121
GIT_REPOSITORY https://github.com/CedricGuillemet/ImGuizmo.git
2222
GIT_SHALLOW TRUE
2323
GIT_TAG 1.83
2424
SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/ImGuizmo"
25-
)
25+
)
2626

2727
FetchContent_Declare(
2828
stb
2929
GIT_REPOSITORY https://github.com/nothings/stb.git
3030
GIT_SHALLOW TRUE
3131
SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/stb
3232
FIND_PACKAGE_ARGS CONFIG
33-
)
33+
)
3434

3535
FetchContent_Declare(
3636
glfw3
3737
GIT_REPOSITORY https://github.com/glfw/glfw.git
3838
GIT_SHALLOW TRUE
3939
GIT_TAG 3.3.10
4040
FIND_PACKAGE_ARGS CONFIG
41-
)
41+
)
4242

4343
FetchContent_Declare(
4444
spdlog
4545
GIT_REPOSITORY https://github.com/gabime/spdlog.git
4646
GIT_SHALLOW TRUE
4747
GIT_TAG v1.15.3
4848
FIND_PACKAGE_ARGS CONFIG
49-
)
49+
)
5050

5151
FetchContent_Declare(
5252
EnTT
5353
GIT_REPOSITORY https://github.com/skypjack/entt.git
5454
GIT_SHALLOW TRUE
5555
GIT_TAG v3.16.0
5656
FIND_PACKAGE_ARGS CONFIG
57-
)
57+
)
5858

5959
FetchContent_Declare(
6060
assimp
6161
GIT_REPOSITORY https://github.com/assimp/assimp.git
6262
GIT_SHALLOW TRUE
6363
FIND_PACKAGE_ARGS CONFIG
64-
)
64+
)
6565

6666
FetchContent_Declare(
6767
stduuid
@@ -75,7 +75,7 @@ FetchContent_Declare(
7575
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp
7676
GIT_SHALLOW TRUE
7777
FIND_PACKAGE_ARGS CONFIG
78-
)
78+
)
7979

8080

8181
FetchContent_Declare(
@@ -84,7 +84,7 @@ FetchContent_Declare(
8484
GIT_TAG vulkan-sdk-1.3.296.0
8585
GIT_SHALLOW TRUE
8686
FIND_PACKAGE_ARGS CONFIG
87-
)
87+
)
8888

8989
FetchContent_Declare(
9090
VulkanMemoryAllocator
@@ -124,23 +124,23 @@ Fetchcontent_Declare(
124124
GTest
125125
GIT_REPOSITORY https://github.com/google/googletest.git
126126
GIT_SHALLOW TRUE
127-
GIT_TAG main
127+
GIT_TAG main
128128
FIND_PACKAGE_ARGS CONFIG
129129
)
130130

131131
Fetchcontent_Declare(
132132
nlohmann_json
133133
GIT_REPOSITORY https://github.com/nlohmann/json.git
134134
GIT_SHALLOW TRUE
135-
FIND_PACKAGE_ARGS CONFIG
135+
FIND_PACKAGE_ARGS CONFIG
136136
)
137137

138138
Fetchcontent_Declare(
139139
tlsf
140140
GIT_REPOSITORY https://github.com/mattconte/tlsf
141141
GIT_SHALLOW TRUE
142142
SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/tlsf
143-
FIND_PACKAGE_ARGS CONFIG
143+
FIND_PACKAGE_ARGS CONFIG
144144
)
145145

146146
Fetchcontent_Declare(
@@ -149,7 +149,7 @@ Fetchcontent_Declare(
149149
GIT_SHALLOW TRUE
150150
GIT_TAG main
151151
SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/CLI11
152-
FIND_PACKAGE_ARGS CONFIG
152+
FIND_PACKAGE_ARGS CONFIG
153153
)
154154

155155

@@ -175,6 +175,7 @@ FetchContent_Declare(Vulkan-Loader
175175
FIND_PACKAGE_ARGS CONFIG
176176
)
177177

178+
178179
FetchContent_MakeAvailable(
179180
fmt
180181
Vulkan-Headers
@@ -200,6 +201,8 @@ FetchContent_MakeAvailable(
200201
GTest
201202
)
202203

204+
find_package(SPIRV-Tools-opt CONFIG)
205+
203206
set(IMGUIDIR ${FETCHCONTENT_BASE_DIR}/imgui)
204207

205208
add_library(imgui STATIC)
@@ -275,6 +278,7 @@ target_link_libraries(External_libs
275278
nlohmann_json::nlohmann_json
276279
)
277280

281+
278282
add_library(imported::ZEngine_External_Dependencies ALIAS External_libs)
279283

280284
add_library(External_obeliskLibs INTERFACE)

vcpkg.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"dependencies": [
3+
"fmt",
4+
"spirv-tools",
5+
"spirv-headers",
6+
"assimp",
7+
"glslang",
8+
"nlohmann-json",
9+
"gtest",
10+
"glfw3",
11+
"spdlog",
12+
"entt",
13+
"stduuid",
14+
"yaml-cpp",
15+
"spirv-cross",
16+
"cli11",
17+
"vulkan-headers",
18+
"vulkan-loader",
19+
"vulkan-memory-allocator"
20+
]
21+
}

0 commit comments

Comments
 (0)