onnxruntime/cmake/target_delayload.cmake
Tiago Koji Castro Shibata f3f119a945
Use onecore umbrella lib in onecore builds (#5182)
* delayload hack

* Skip tests

* Onecore uses onecore umbrella

* Uncomment tests

* cleanup

* Disable dev mode for WinML
2020-09-16 10:46:27 -07:00

17 lines
583 B
CMake

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Add delayloaded libraries to a target
function(target_delayload target_name)
if(NOT MSVC)
message(SEND_ERROR "Delayloading is only supported in MSVC")
endif()
foreach(lib ${ARGN})
target_link_options(${target_name} PRIVATE /DELAYLOAD:"${lib}")
endforeach()
if (WINDOWS_STORE)
target_link_libraries(${target_name} PRIVATE dloadhelper.lib)
else()
target_link_libraries(${target_name} PRIVATE delayimp.lib)
endif()
endfunction()