diff --git a/cmake/external/dml.cmake b/cmake/external/dml.cmake index 552ebe887a197..a7f3f7991fdad 100644 --- a/cmake/external/dml.cmake +++ b/cmake/external/dml.cmake @@ -100,6 +100,9 @@ else() endif() endif() +if(onnxruntime_USE_VCPKG){ + find_package(directx-headers CONFIG REQUIRED) +else() onnxruntime_fetchcontent_declare( directx_headers URL ${DEP_URL_directx_headers} @@ -109,5 +112,5 @@ onnxruntime_fetchcontent_declare( FetchContent_Populate(directx_headers) set(directx_headers_INCLUDE_DIRS "${directx_headers_SOURCE_DIR}/include") - include_directories(BEFORE ${directx_headers_INCLUDE_DIRS}) +endif() \ No newline at end of file diff --git a/cmake/onnxruntime_providers_dml.cmake b/cmake/onnxruntime_providers_dml.cmake index 3141aa85a1163..e5ff19f133ee5 100644 --- a/cmake/onnxruntime_providers_dml.cmake +++ b/cmake/onnxruntime_providers_dml.cmake @@ -11,6 +11,9 @@ onnxruntime_add_include_to_target(onnxruntime_providers_dml onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface ${WIL_TARGET} ) + if(TARGET Microsoft::DirectX-Headers) + onnxruntime_add_include_to_target(onnxruntime_providers_dml Microsoft::DirectX-Headers) + endif() add_dependencies(onnxruntime_providers_dml ${onnxruntime_EXTERNAL_DEPENDENCIES}) target_include_directories(onnxruntime_providers_dml PRIVATE ${ONNXRUNTIME_ROOT} diff --git a/cmake/vcpkg.json b/cmake/vcpkg.json index 756ceb879afa2..afd2a7ccdb3d5 100644 --- a/cmake/vcpkg.json +++ b/cmake/vcpkg.json @@ -91,6 +91,12 @@ "dependencies": [ "fp16" ] + }, + "dml-ep": { + "description": "Build with CoreML EP", + "dependencies": [ + "directx-headers" + ] } }, "overrides": [ diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 078f84fc7e434..57445c0b3de4d 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1077,9 +1077,9 @@ def generate_vcpkg_install_options(source_dir, args): "--x-asset-sources=x-azurl,https://vcpkg.storage.devpackages.microsoft.io/artifacts/\\;x-block-origin" ) if SYSTEM_COLLECTIONURI == "https://dev.azure.com/onnxruntime/": - vcpkg_install_options.append("--binarysource=x-az-universal,onnxruntime,onnxruntime,onnxruntime,rw") + vcpkg_install_options.append("--binarysource=x-az-universal,onnxruntime,onnxruntime,onnxruntime,readwrite") elif SYSTEM_COLLECTIONURI == "https://dev.azure.com/aiinfra/" or SYSTEM_COLLECTIONURI == "https://aiinfra.visualstudio.com/": - vcpkg_install_options.append("--binarysource=x-az-universal,aiinfra,Lotus,Lotus,rw") + vcpkg_install_options.append("--binarysource=x-az-universal,aiinfra,Lotus,Lotus,readwrite") # Config binary cache return vcpkg_install_options