From 936858e1c600f0f27c97452bae12e8ee439b42ef Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Sat, 14 Dec 2024 23:09:14 -0800 Subject: [PATCH] add macro condition for monolib --- onnxruntime/core/dll/delay_load_hook.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/dll/delay_load_hook.cc b/onnxruntime/core/dll/delay_load_hook.cc index 55d5b0e270629..1a02294c1a059 100644 --- a/onnxruntime/core/dll/delay_load_hook.cc +++ b/onnxruntime/core/dll/delay_load_hook.cc @@ -20,11 +20,11 @@ // - https://learn.microsoft.com/en-us/cpp/build/reference/understanding-the-helper-function?view=msvc-170#structure-and-constant-definitions // - https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#alternate-search-order-for-unpackaged-apps // -// The DLL DelayLoad hook is only enabled when: -// - The compiler is MSVC -// - at least one of USE_WEBGPU or USE_DML is defined +// The DLL DelayLoad hook is only enabled when the compiler is MSVC and at least one of the following is True: +// - both USE_WEBGPU and BUILD_DAWN_MONOLITHIC_LIBRARY are defined +// - USE_DML is defined // -#if defined(_MSC_VER) && (defined(USE_WEBGPU) || defined(USE_DML)) +#if defined(_MSC_VER) && ((defined(USE_WEBGPU) && defined(BUILD_DAWN_MONOLITHIC_LIBRARY)) || defined(USE_DML)) #include #include