onnxruntime/cmake/external/wil.cmake
Matthieu Darbois 5e971bc51a
Rework WIL dependency retrieval/usage (#17130)
### Description
1. `onnxruntime_fetchcontent_makeavailable` works around unconditional
install commands so that can be used instead of `FetchContent_Populate`
2. This dependency is Windows specific, mark it as such.

### Motivation and Context
1. This simplifies `cmake/external/wil.cmake` not to do anything
specific wether WIL was fetched or found
2. Given it's specific to Windows, it might not be available on other OS
in specific air-gapped environment such as
[conan-center-index](https://github.com/conan-io/conan-center-index).
This allows downstream builds not to require specific patches for
something not required by the build in the first place.
2023-08-15 09:11:46 -07:00

16 lines
436 B
CMake

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
set(WIL_BUILD_PACKAGING OFF CACHE BOOL "" FORCE)
set(WIL_BUILD_TESTS OFF CACHE BOOL "" FORCE)
FetchContent_Declare(
microsoft_wil
URL ${DEP_URL_microsoft_wil}
URL_HASH SHA1=${DEP_SHA1_microsoft_wil}
FIND_PACKAGE_ARGS NAMES wil
)
if(WIN32)
onnxruntime_fetchcontent_makeavailable(microsoft_wil)
set(WIL_TARGET "WIL::WIL")
endif()