Skip to content

Commit

Permalink
Make ORT and Dawn use the same protobuf/abseil source code (#23447)
Browse files Browse the repository at this point in the history
### Description
Make ORT and Dawn use the same protobuf/abseil source code
  • Loading branch information
snnn authored Jan 22, 2025
1 parent 628c0e0 commit 368e243
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmake/external/abseil-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ FetchContent_Declare(

onnxruntime_fetchcontent_makeavailable(abseil_cpp)
FetchContent_GetProperties(abseil_cpp)
set(ABSEIL_SOURCE_DIR ${abseil_cpp_SOURCE_DIR})
if(abseil_cpp_SOURCE_DIR)
set(ABSEIL_SOURCE_DIR ${abseil_cpp_SOURCE_DIR})
if(onnxruntime_USE_WEBGPU)
set(DAWN_ABSEIL_DIR ${abseil_cpp_SOURCE_DIR})
endif()
endif()

# abseil_cpp_SOURCE_DIR is non-empty if we build it from source
message(STATUS "Abseil source dir:" ${ABSEIL_SOURCE_DIR})
# abseil_cpp_VERSION is non-empty if we find a preinstalled ABSL
Expand Down
5 changes: 5 additions & 0 deletions cmake/external/onnxruntime_external_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ onnxruntime_fetchcontent_makeavailable(Protobuf)
if(Protobuf_FOUND)
message(STATUS "Protobuf version: ${Protobuf_VERSION}")
else()
if(protobuf_SOURCE_DIR)
if(onnxruntime_USE_WEBGPU)
set(DAWN_PROTOBUF_DIR ${protobuf_SOURCE_DIR})
endif()
endif()
# Adjust warning flags
if (TARGET libprotoc)
if (NOT MSVC)
Expand Down

0 comments on commit 368e243

Please sign in to comment.