Skip to content

Commit 220c1a2

Browse files
snnnashrit-ms
authored andcommitted
Make ORT and Dawn use the same protobuf/abseil source code (#23447)
### Description Make ORT and Dawn use the same protobuf/abseil source code
1 parent b7b5792 commit 220c1a2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cmake/external/abseil-cpp.cmake

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ FetchContent_Declare(
3232

3333
onnxruntime_fetchcontent_makeavailable(abseil_cpp)
3434
FetchContent_GetProperties(abseil_cpp)
35-
set(ABSEIL_SOURCE_DIR ${abseil_cpp_SOURCE_DIR})
35+
if(abseil_cpp_SOURCE_DIR)
36+
set(ABSEIL_SOURCE_DIR ${abseil_cpp_SOURCE_DIR})
37+
if(onnxruntime_USE_WEBGPU)
38+
set(DAWN_ABSEIL_DIR ${abseil_cpp_SOURCE_DIR})
39+
endif()
40+
endif()
41+
3642
# abseil_cpp_SOURCE_DIR is non-empty if we build it from source
3743
message(STATUS "Abseil source dir:" ${ABSEIL_SOURCE_DIR})
3844
# abseil_cpp_VERSION is non-empty if we find a preinstalled ABSL

cmake/external/onnxruntime_external_deps.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ onnxruntime_fetchcontent_makeavailable(Protobuf)
222222
if(Protobuf_FOUND)
223223
message(STATUS "Protobuf version: ${Protobuf_VERSION}")
224224
else()
225+
if(protobuf_SOURCE_DIR)
226+
if(onnxruntime_USE_WEBGPU)
227+
set(DAWN_PROTOBUF_DIR ${protobuf_SOURCE_DIR})
228+
endif()
229+
endif()
225230
# Adjust warning flags
226231
if (TARGET libprotoc)
227232
if (NOT MSVC)

0 commit comments

Comments
 (0)