@@ -107,6 +107,23 @@ if(onnxruntime_USE_MIMALLOC)
107
107
FetchContent_MakeAvailable(mimalloc)
108
108
endif ()
109
109
110
+ #Protobuf depends on utf8_range
111
+ onnxruntime_fetchcontent_declare(
112
+ utf8_range
113
+ URL ${DEP_URL_utf8_range}
114
+ URL_HASH SHA1=${DEP_SHA1_utf8_range}
115
+ EXCLUDE_FROM_ALL
116
+ FIND_PACKAGE_ARGS NAMES utf8_range
117
+ )
118
+
119
+ set (utf8_range_ENABLE_TESTS OFF CACHE BOOL "Build test suite" FORCE)
120
+ set (utf8_range_ENABLE_INSTALL OFF CACHE BOOL "Configure installation" FORCE)
121
+
122
+ # The next line will generate an error message "fatal: not a git repository", but it is ok. It is from flatbuffers
123
+ onnxruntime_fetchcontent_makeavailable(utf8_range)
124
+ # protobuf's cmake/utf8_range.cmake has the following line
125
+ include_directories (${utf8_range_SOURCE_DIR} )
126
+
110
127
# Download a protoc binary from Internet if needed
111
128
if (NOT ONNX_CUSTOM_PROTOC_EXECUTABLE AND NOT onnxruntime_USE_VCPKG)
112
129
# This part of code is only for users' convenience. The code couldn't handle all cases. Users always can manually
@@ -287,7 +304,7 @@ if(NOT TARGET Boost::mp11)
287
304
EXCLUDE_FROM_ALL
288
305
FIND_PACKAGE_ARGS NAMES Boost
289
306
)
290
- onnxruntime_fetchcontent_makeavailable(mp11)
307
+ onnxruntime_fetchcontent_makeavailable(mp11)
291
308
if (NOT TARGET Boost::mp11)
292
309
add_library (Boost::mp11 ALIAS Boost::headers)
293
310
endif ()
@@ -425,9 +442,6 @@ target_include_directories(safeint_interface INTERFACE ${safeint_SOURCE_DIR})
425
442
426
443
427
444
# Flatbuffers
428
- if (onnxruntime_USE_VCPKG)
429
- find_package (flatbuffers REQUIRED)
430
- else ()
431
445
# We do not need to build flatc for iOS or Android Cross Compile
432
446
if (CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "Emscripten" )
433
447
set (FLATBUFFERS_BUILD_FLATC OFF CACHE BOOL "FLATBUFFERS_BUILD_FLATC" FORCE)
@@ -478,7 +492,6 @@ namespace std { using ::getenv; }
478
492
endif ()
479
493
endif ()
480
494
endif ()
481
- endif ()
482
495
483
496
# ONNX
484
497
if (NOT onnxruntime_USE_FULL_PROTOBUF)
@@ -659,10 +672,17 @@ if (onnxruntime_USE_WEBGPU)
659
672
660
673
# disable things we don't use
661
674
set (DAWN_DXC_ENABLE_ASSERTS_IN_NDEBUG OFF )
675
+ set (DAWN_ENABLE_DESKTOP_GL OFF CACHE BOOL "" FORCE)
676
+ set (DAWN_ENABLE_OPENGLES OFF CACHE BOOL "" FORCE)
677
+ set (DAWN_SUPPORTS_GLFW_FOR_WINDOWING OFF CACHE BOOL "" FORCE)
678
+ set (DAWN_USE_GLFW OFF CACHE BOOL "" FORCE)
679
+ set (DAWN_USE_WINDOWS_UI OFF CACHE BOOL "" FORCE)
662
680
set (DAWN_USE_X11 OFF CACHE BOOL "" FORCE)
663
681
664
682
set (TINT_BUILD_TESTS OFF CACHE BOOL "" FORCE)
665
683
set (TINT_BUILD_CMD_TOOLS OFF CACHE BOOL "" FORCE)
684
+ set (TINT_BUILD_GLSL_WRITER OFF CACHE BOOL "" FORCE)
685
+ set (TINT_BUILD_GLSL_VALIDATOR OFF CACHE BOOL "" FORCE)
666
686
set (TINT_BUILD_IR_BINARY OFF CACHE BOOL "" FORCE)
667
687
set (TINT_BUILD_SPV_READER OFF CACHE BOOL "" FORCE) # don't need. disabling is a large binary size saving
668
688
set (TINT_BUILD_WGSL_WRITER ON CACHE BOOL "" FORCE) # needed to create cache key. runtime error if not enabled.
@@ -712,29 +732,7 @@ if (onnxruntime_USE_WEBGPU)
712
732
# # if we need to apply patches in the future, we can uncomment the following line.
713
733
#
714
734
# The dawn.patch contains the following changes:
715
- #
716
- # - (public) CMake fix to support Emscripten v4.0.3+
717
- # This change allows Dawn to find the file "gen_struct_info.py" in the correct location.
718
- # https://dawn-review.googlesource.com/c/dawn/+/225514
719
- #
720
- # - (public) Fix emwgpu C++ implementation for buffer destroy
721
- # In native implementation, wgpuBufferRelease will trigger the buffer destroy (if refcount decreased to 0). But
722
- # in emwgpu implementation, the buffer destroy won't happen. This change fixes the bug.
723
- # https://dawn-review.googlesource.com/c/dawn/+/226315
724
- #
725
- # - (private) Allow "external" buffer in emwgpu C++ implementation
726
- # This change allows WGPUBufferImpl to destroy the buffer when the refcount decreased to 0 only for non-external
727
- # buffer.
728
- # "external buffer" means the GPUBuffer instance created in JavaScript and imported to C++ by `importJsBuffer`.
729
- #
730
- # - (private) Remove hard-coded CMAKE_OSX_DEPLOYMENT_TARGET in Dawn's CMake files
731
- # https://github.com/microsoft/onnxruntime/pull/23729
732
- #
733
- # - (private) Fix external ref count for "external" device in emwgpu C++ implementation
734
- # This change fixes the incorrect external ref count for class WGPUDeviceImpl when used with "external" device.
735
- # "external device" means the GPUDevice instance created in JavaScript and imported to C++ by `importJsDevice`.
736
- #
737
- #
735
+ # - https://dawn-review.googlesource.com/c/dawn/+/225514
738
736
PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore -whitespace -p1 < ${PROJECT_SOURCE_DIR} /patches/dawn/dawn.patch
739
737
EXCLUDE_FROM_ALL
740
738
)
0 commit comments