Skip to content

Commit 44823ee

Browse files
committed
add dependency dawn
1 parent beabf6a commit 44823ee

File tree

9 files changed

+59
-15
lines changed

9 files changed

+59
-15
lines changed

.github/workflows/codeql.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ jobs:
2222
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
25-
with:
26-
submodules: recursive
2725

2826
- name: Initialize CodeQL
2927
uses: github/codeql-action/init@v2

.github/workflows/tests.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ jobs:
3131
git --version
3232
3333
- uses: actions/checkout@v4
34-
with:
35-
submodules: recursive
3634

3735
- name: Configure
3836
shell: bash
@@ -124,8 +122,6 @@ jobs:
124122
${{ matrix.compiler.cxx }} --version
125123
126124
- uses: actions/checkout@v4
127-
with:
128-
submodules: recursive
129125

130126
- name: Configure
131127
run: |
@@ -184,8 +180,6 @@ jobs:
184180
sudo apt-get install -y xorg-dev libwayland-dev libxkbcommon-dev libpulse-dev libasound2-dev nasm libssl-dev
185181
186182
- uses: actions/checkout@v4
187-
with:
188-
submodules: recursive
189183

190184
- name: Configure
191185
run: |
@@ -246,8 +240,6 @@ jobs:
246240
clang++ --version
247241
248242
- uses: actions/checkout@v4
249-
with:
250-
submodules: recursive
251243

252244
- name: Configure
253245
run: |
@@ -289,8 +281,6 @@ jobs:
289281
clang++ --version
290282
291283
- uses: actions/checkout@v4
292-
with:
293-
submodules: recursive
294284

295285
- name: Configure
296286
run: |

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,6 @@
121121
[submodule "externals/wamr/zydis"]
122122
path = externals/wamr/zydis
123123
url = https://github.com/zyantific/zydis.git
124+
[submodule "externals/dawn/dawn"]
125+
path = externals/dawn/dawn
126+
url = https://dawn.googlesource.com/dawn

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ if(WIN32)
1515
message(STATUS "CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
1616
endif()
1717

18+
execute_process(COMMAND "bash" "${CMAKE_CURRENT_LIST_DIR}/submodules.sh" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" COMMAND_ECHO STDOUT COMMAND_ERROR_IS_FATAL ANY)
19+
1820
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1921
include(cage_all)
2022

externals/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# override cmake minimum version for dependencies
23
set(CMAKE_POLICY_VERSION_MINIMUM 3.31)
34

@@ -92,18 +93,20 @@ add_subdirectory(mbedtls)
9293
add_subdirectory(curl)
9394
add_subdirectory(cpr)
9495

95-
add_subdirectory(fastnoise)
96+
add_subdirectory(dawn)
9697
add_subdirectory(glad)
9798
add_subdirectory(glfw)
9899
add_subdirectory(glm)
99100
add_subdirectory(openxr-sdk)
101+
102+
add_subdirectory(fastnoise)
100103
add_subdirectory(plf)
101104
add_subdirectory(simplefilewatcher)
102105
add_subdirectory(stb)
103106
add_subdirectory(unordered_dense)
104107
add_subdirectory(wamr)
105108

106-
if (cage_use_steam_sockets)
109+
if(cage_use_steam_sockets)
107110
add_subdirectory(protobuf)
108111
add_subdirectory(gamenetworkingsockets)
109112
endif()

externals/dawn/CMakeLists.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
set(CMAKE_DISABLE_FIND_PACKAGE_Python3 OFF)
3+
4+
set(DAWN_ENABLE_INSTALL ON CACHE INTERNAL "Enable install step for Dawn libraries" FORCE)
5+
set(DAWN_ENABLE_D3D11 OFF CACHE INTERNAL "Enable compilation of the D3D11 backend" FORCE)
6+
set(DAWN_ENABLE_D3D12 OFF CACHE INTERNAL "Enable compilation of the D3D12 backend" FORCE)
7+
set(DAWN_ENABLE_METAL OFF CACHE INTERNAL "Enable compilation of the Metal backend" FORCE)
8+
set(DAWN_ENABLE_NULL OFF CACHE INTERNAL "Enable compilation of the Null backend" FORCE)
9+
set(DAWN_ENABLE_WEBGPU_ON_WEBGPU OFF CACHE INTERNAL "Enable compilation of the WebGPU backend" FORCE)
10+
set(DAWN_ENABLE_DESKTOP_GL OFF CACHE INTERNAL "Enable compilation of the OpenGL backend" FORCE)
11+
set(DAWN_ENABLE_OPENGLES OFF CACHE INTERNAL "Enable compilation of the OpenGL ES backend" FORCE)
12+
set(DAWN_ENABLE_VULKAN ON CACHE INTERNAL "Enable compilation of the Vulkan backend" FORCE)
13+
set(DAWN_USE_WAYLAND OFF CACHE INTERNAL "Enable support for Wayland surface" FORCE)
14+
set(DAWN_USE_X11 OFF CACHE INTERNAL "Enable support for X11 surface" FORCE)
15+
set(DAWN_USE_GLFW OFF CACHE INTERNAL "Enable compilation of the GLFW windowing utils" FORCE)
16+
set(DAWN_USE_WINDOWS_UI OFF CACHE INTERNAL "Enable support for Windows UI surface" FORCE)
17+
set(DAWN_BUILD_SAMPLES OFF CACHE INTERNAL "Enables building Dawn's samples" FORCE)
18+
set(DAWN_BUILD_TESTS OFF CACHE INTERNAL "Enables building Dawn's tests" FORCE)
19+
set(DAWN_BUILD_PROTOBUF OFF CACHE INTERNAL "Build the protobuf dependencies" FORCE)
20+
set(DAWN_ENABLE_PIC ON CACHE INTERNAL "Build with Position-Independent-Code enabled" FORCE)
21+
set(DAWN_BUILD_MONOLITHIC_LIBRARY "STATIC" CACHE INTERNAL "Build monolithic library: SHARED, STATIC, or OFF." FORCE)
22+
23+
set(TINT_BUILD_SPV_READER ON CACHE INTERNAL "Build the SPIR-V input reader" FORCE)
24+
set(TINT_BUILD_WGSL_READER ON CACHE INTERNAL "Build the WGSL input reader" FORCE)
25+
set(TINT_BUILD_GLSL_WRITER OFF CACHE INTERNAL "Build the GLSL output writer" FORCE)
26+
set(TINT_BUILD_GLSL_VALIDATOR OFF CACHE INTERNAL "Build the GLSL output validator" FORCE)
27+
set(TINT_BUILD_HLSL_WRITER OFF CACHE INTERNAL "Build the HLSL output writer" FORCE)
28+
set(TINT_BUILD_MSL_WRITER OFF CACHE INTERNAL "Build the MSL output writer" FORCE)
29+
set(TINT_BUILD_SPV_WRITER ON CACHE INTERNAL "Build the SPIR-V output writer" FORCE)
30+
set(TINT_BUILD_WGSL_WRITER ON CACHE INTERNAL "Build the WGSL output writer" FORCE)
31+
32+
set(TINT_ENABLE_INSTALL OFF CACHE INTERNAL "Enable install step for Tint libraries" FORCE)
33+
set(TINT_BUILD_CMD_TOOLS OFF CACHE INTERNAL "Build the Tint command line tools" FORCE)
34+
set(TINT_BUILD_IR_BINARY OFF CACHE INTERNAL "Build IR binary format support" FORCE)
35+
set(TINT_BUILD_TESTS OFF CACHE INTERNAL "Build tests" FORCE)
36+
set(TINT_ENABLE_IR_VALIDATION ON CACHE INTERNAL "Enable IR validation for backend codegen" FORCE)
37+
38+
add_subdirectory(dawn)
39+
40+
set_target_properties(webgpu_dawn PROPERTIES PREFIX cage-)
41+
set_target_properties(webgpu_dawn PROPERTIES DEBUG_POSTFIX _debug)
42+
43+
add_library(webgpu::dawn ALIAS webgpu_dawn)

externals/dawn/dawn

Submodule dawn added at ee1c628

sources/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ cage_ide_sort_files(cage-core)
7373

7474
file(GLOB_RECURSE cage-engine-sources "libengine/*" "include/cage-engine/*")
7575
add_library(cage-engine SHARED ${cage-engine-sources})
76-
target_link_libraries(cage-engine PRIVATE cubeb glfw openxr_loader freetype harfbuzz SheenBidi)
76+
target_link_libraries(cage-engine PRIVATE cubeb glfw webgpu::dawn openxr_loader freetype harfbuzz SheenBidi)
7777
target_link_libraries(cage-engine PUBLIC cage-core glad)
7878
file(GLOB_RECURSE controller-bindings RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "controller-bindings/*")
7979
set(index 0)

submodules.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
git submodule update --init
4+
(cd externals/dawn/dawn/third_party && git submodule update --init)

0 commit comments

Comments
 (0)