mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
14 lines
464 B
CMake
14 lines
464 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()
|
|
|
|
target_link_libraries(${target_name} PRIVATE delayimp.lib)
|
|
endfunction()
|