From f550822f74b10e7ae8e28264a5a896a2397c5136 Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Wed, 21 May 2025 18:27:39 -0700 Subject: [PATCH] [build] disable vcpkg for Dawn temporarily --- cmake/external/onnxruntime_external_deps.cmake | 6 +++++- cmake/onnxruntime_providers_webgpu.cmake | 2 +- cmake/patches/dawn/dawn_fix_copy_dxil_dll.patch | 13 +++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 cmake/patches/dawn/dawn_fix_copy_dxil_dll.patch diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index 4ed74f1315cb5..fd8d6bc154367 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -625,7 +625,11 @@ endif() if (onnxruntime_USE_WEBGPU) - if (onnxruntime_USE_VCPKG AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") + + # the following code is used to disable building Dawn using vcpkg temporarily + # until we figure out how to resolve the packaging pipeline failures + if (FALSE) + # if (onnxruntime_USE_VCPKG AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # vcpkg does not support Emscripten yet find_package(dawn REQUIRED) else() diff --git a/cmake/onnxruntime_providers_webgpu.cmake b/cmake/onnxruntime_providers_webgpu.cmake index 7a7e0d39fcd2d..d34a8a3bbd2e0 100644 --- a/cmake/onnxruntime_providers_webgpu.cmake +++ b/cmake/onnxruntime_providers_webgpu.cmake @@ -59,7 +59,7 @@ list(APPEND onnxruntime_DELAYLOAD_FLAGS "/DELAYLOAD:webgpu_dawn.dll") endif() - if (onnxruntime_USE_VCPKG) + if (onnxruntime_USE_VCPKG AND FALSE) # temporarily disable this until we can fix the vcpkg build issue # Fix Dawn vcpkg build issue (missing IMPORTED_IMPLIB and IMPORTED_LOCATION for target dawn::webgpu_dawn) get_target_property(webgpu_dawn_target_IMPORTED_IMPLIB dawn::webgpu_dawn IMPORTED_IMPLIB) if (NOT webgpu_dawn_target_IMPORTED_IMPLIB) diff --git a/cmake/patches/dawn/dawn_fix_copy_dxil_dll.patch b/cmake/patches/dawn/dawn_fix_copy_dxil_dll.patch new file mode 100644 index 0000000000000..cd4d53b4cbdb7 --- /dev/null +++ b/cmake/patches/dawn/dawn_fix_copy_dxil_dll.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt +index cdfde38819..fc5ff76421 100644 +--- a/third_party/CMakeLists.txt ++++ b/third_party/CMakeLists.txt +@@ -352,6 +352,8 @@ function(AddSubdirectoryDXC) + TARGET copy_dxil_dll + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DXIL_DLL_PATH} $ + COMMENT "Copying ${DXIL_DLL_PATH} to $") ++ # Ensure folder "$" exists when copying the dll ++ add_dependencies(copy_dxil_dll dxcompiler) + # Make dxc target depend on copy_dxil_dll + add_dependencies(dxc copy_dxil_dll) + endif()