Skip to content

Commit 23fc4d8

Browse files
committed
remove custom protobuf and use the one from dawn
1 parent 9d3a09f commit 23fc4d8

File tree

10 files changed

+38
-97
lines changed

10 files changed

+38
-97
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@
9191
[submodule "externals/gamenetworkingsockets/GameNetworkingSockets"]
9292
path = externals/gamenetworkingsockets/GameNetworkingSockets
9393
url = https://github.com/ValveSoftware/GameNetworkingSockets.git
94-
[submodule "externals/protobuf/protobuf"]
95-
path = externals/protobuf/protobuf
96-
url = https://github.com/protocolbuffers/protobuf.git
9794
[submodule "externals/quickhull/quickhull"]
9895
path = externals/quickhull/quickhull
9996
url = https://github.com/akuukka/quickhull.git

cmake/cage_copy_redist.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ function(cage_copy_redist_license sourcePath targetName)
77
endfunction(cage_copy_redist_license)
88

99
function(cage_copy_redist)
10+
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../LICENSE" "cage" COPYONLY)
1011
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/assimp/assimp/LICENSE" "assimp" COPYONLY)
1112
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/avir/avir/LICENSE" "avir" COPYONLY)
1213
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/bc7enc_rdo/bc7enc_rdo/LICENSE" "bc7enc_rdo" COPYONLY)
1314
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/cpr/cpr/LICENSE" "cpr" COPYONLY)
1415
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/cubeb/cubeb/LICENSE" "cubeb" COPYONLY)
1516
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/curl/curl/COPYING" "curl" COPYONLY)
17+
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/dawn/dawn/LICENSE" "dawn" COPYONLY)
1618
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/dr_libs/dr_libs/README.md" "dr_libs" COPYONLY)
1719
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/dualmc/dualmc/LICENSE" "dualmc" COPYONLY)
1820
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/fastnoise/fastnoise/LICENSE" "fastnoise" COPYONLY)
@@ -34,7 +36,6 @@ function(cage_copy_redist)
3436
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/pmp/pmp/LICENSE.txt" "pmp" COPYONLY)
3537
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/pmp/pmp/external/eigen-3.4.0/COPYING.MPL2" "pmp_eigen" COPYONLY)
3638
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/png/png/LICENSE" "png" COPYONLY)
37-
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/protobuf/protobuf/LICENSE" "protobuf" COPYONLY)
3839
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/quickhull/quickhull/README.md" "quickhull" COPYONLY)
3940
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/samplerate/libsamplerate/COPYING" "samplerate" COPYONLY)
4041
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/simplefilewatcher/simplefilewatcher/License.txt" "simplefilewatcher" COPYONLY)
@@ -48,5 +49,4 @@ function(cage_copy_redist)
4849
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/xatlas/xatlas/LICENSE" "xatlas" COPYONLY)
4950
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/zlib-ng/zlib-ng/LICENSE.md" "zlib-ng" COPYONLY)
5051
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../externals/zstd/zstd/LICENSE" "zstd" COPYONLY)
51-
cage_copy_redist_license("${cage_copy_redist_current_list_dir}/../LICENSE" "cage" COPYONLY)
5252
endfunction(cage_copy_redist)

externals/CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set(CMAKE_DISABLE_FIND_PACKAGE_OpenGL ON)
2727
set(CMAKE_DISABLE_FIND_PACKAGE_PNG ON)
2828
set(CMAKE_DISABLE_FIND_PACKAGE_Perl ON)
2929
set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig ON)
30-
set(CMAKE_DISABLE_FIND_PACKAGE_Python3 ON)
30+
#set(CMAKE_DISABLE_FIND_PACKAGE_Python3 ON)
3131
set(CMAKE_DISABLE_FIND_PACKAGE_PythonInterp ON)
3232
set(CMAKE_DISABLE_FIND_PACKAGE_SndFile ON)
3333
set(CMAKE_DISABLE_FIND_PACKAGE_liblzma ON)
@@ -93,22 +93,21 @@ add_subdirectory(mbedtls)
9393
add_subdirectory(curl)
9494
add_subdirectory(cpr)
9595

96-
add_subdirectory(dawn)
97-
add_subdirectory(glad)
98-
add_subdirectory(glfw)
99-
add_subdirectory(glm)
100-
add_subdirectory(openxr-sdk)
101-
10296
add_subdirectory(fastnoise)
10397
add_subdirectory(plf)
10498
add_subdirectory(simplefilewatcher)
10599
add_subdirectory(stb)
106100
add_subdirectory(unordered_dense)
107101
add_subdirectory(wamr)
108102

103+
add_subdirectory(dawn)
104+
add_subdirectory(glad)
105+
add_subdirectory(glfw)
106+
add_subdirectory(glm)
107+
add_subdirectory(openxr-sdk)
108+
109109
if(cage_use_steam_sockets)
110-
add_subdirectory(protobuf)
111-
add_subdirectory(gamenetworkingsockets)
110+
add_subdirectory(gamenetworkingsockets) # uses protobuf from dawn
112111
endif()
113112

114113
message(STATUS "----------------------------------------------------------------")

externals/dawn/CMakeLists.txt

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
message(STATUS "----------------------------------------------------------------")
2+
message(STATUS "dawn")
3+
message(STATUS "----------------------------------------------------------------")
14

25
set(CMAKE_DISABLE_FIND_PACKAGE_Python3 OFF)
36

@@ -16,7 +19,7 @@ set(DAWN_USE_GLFW OFF CACHE INTERNAL "Enable compilation of the GLFW windowing u
1619
set(DAWN_USE_WINDOWS_UI OFF CACHE INTERNAL "Enable support for Windows UI surface" FORCE)
1720
set(DAWN_BUILD_SAMPLES OFF CACHE INTERNAL "Enables building Dawn's samples" FORCE)
1821
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)
22+
set(DAWN_BUILD_PROTOBUF ${cage_use_steam_sockets} CACHE INTERNAL "Build the protobuf dependencies" FORCE)
2023
set(DAWN_ENABLE_PIC ON CACHE INTERNAL "Build with Position-Independent-Code enabled" FORCE)
2124
set(DAWN_BUILD_MONOLITHIC_LIBRARY "STATIC" CACHE INTERNAL "Build monolithic library: SHARED, STATIC, or OFF." FORCE)
2225

@@ -35,9 +38,29 @@ set(TINT_BUILD_IR_BINARY OFF CACHE INTERNAL "Build IR binary format support" FOR
3538
set(TINT_BUILD_TESTS OFF CACHE INTERNAL "Build tests" FORCE)
3639
set(TINT_ENABLE_IR_VALIDATION ON CACHE INTERNAL "Enable IR validation for backend codegen" FORCE)
3740

38-
add_subdirectory(dawn)
41+
add_library(libprotobuf-mutator INTERFACE) # subvert unnecessary dependencies
3942

40-
set_target_properties(webgpu_dawn PROPERTIES PREFIX cage-)
41-
set_target_properties(webgpu_dawn PROPERTIES DEBUG_POSTFIX _debug)
43+
add_subdirectory(dawn)
4244

4345
add_library(webgpu::dawn ALIAS webgpu_dawn)
46+
47+
48+
49+
# make protobuf available to steam sockets
50+
if(cage_use_steam_sockets)
51+
set(filename "${CAGE_EXTERNALS_MODULE_PATH}/FindProtobuf.cmake")
52+
file(WRITE ${filename} "\n")
53+
macro(append_lib varname libname)
54+
set(lib $<TARGET_LINKER_FILE:${libname}>)
55+
set(inc $<TARGET_PROPERTY:${libname},INTERFACE_INCLUDE_DIRECTORIES>)
56+
cage_gen_module_helper(${filename} ${varname} "${lib}" "${inc}")
57+
endmacro()
58+
append_lib(Protobuf protobuf)
59+
append_lib(Protobuf_LITE protobuf-lite)
60+
append_lib(Protobuf_PROTOC protoc)
61+
file(APPEND "${filename}" "set(Protobuf_PROTOC_EXECUTABLE protobuf::protoc)\n")
62+
configure_file("${CMAKE_CURRENT_LIST_DIR}/dawn/third_party/protobuf/cmake/protobuf-generate.cmake" "${CAGE_EXTERNALS_MODULE_PATH}/dawn/third_party/protobuf/protobuf-generate.cmake" COPYONLY)
63+
file(APPEND "${filename}" "include(\${CMAKE_CURRENT_LIST_DIR}/dawn/third_party/protobuf/protobuf-generate.cmake)\n")
64+
configure_file("${CMAKE_CURRENT_LIST_DIR}/dawn/third_party/protobuf/cmake/protobuf-module.cmake.in" "${CAGE_EXTERNALS_MODULE_PATH}/dawn/third_party/protobuf/protobuf-module.cmake" COPYONLY)
65+
file(APPEND "${filename}" "include(\${CMAKE_CURRENT_LIST_DIR}/dawn/third_party/protobuf/protobuf-module.cmake)\n")
66+
endif()

externals/fetch_latest.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ export -f pbranch
1515
git submodule foreach pbranch
1616

1717

18-
# restore protobuf - newer versions are incompatible with the protoc compiler
19-
git submodule update protobuf/protobuf
20-
2118
# restore openxr - newer versions are not supported by hardware
2219
git submodule update openxr-sdk/OpenXR-SDK
2320

externals/protobuf/CMakeLists.txt

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

externals/protobuf/protobuf

Lines changed: 0 additions & 1 deletion
This file was deleted.
-3.22 MB
Binary file not shown.
-3.87 MB
Binary file not shown.

submodules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

33
git submodule update --init
4-
(cd externals/dawn/dawn/third_party && git submodule update --init)
4+
(cd externals/dawn/dawn && git submodule update --init "third_party/abseil-cpp" "third_party/protobuf" "third_party/spirv-headers/src" "third_party/spirv-tools/src" "third_party/vulkan-headers/src" "third_party/vulkan-utility-libraries/src" "third_party/jinja2" "third_party/markupsafe")
55
(cd externals/wamr/zydis/dependencies && git submodule update --init)

0 commit comments

Comments
 (0)