File: target_delayload.cmake

package info (click to toggle)
onnxruntime 1.21.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 333,732 kB
  • sloc: cpp: 3,153,079; python: 179,219; ansic: 109,131; asm: 37,791; cs: 34,424; perl: 13,070; java: 11,047; javascript: 6,330; pascal: 4,126; sh: 3,277; xml: 598; objc: 281; makefile: 59
file content (17 lines) | stat: -rw-r--r-- 543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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()
    if(onnxruntime_ENABLE_DELAY_LOADING_WIN_DLLS)
        foreach(lib ${ARGN})
            target_link_options(${target_name} PRIVATE /DELAYLOAD:"${lib}")
        endforeach()

        target_link_libraries(${target_name} PRIVATE delayimp.lib)
    endif()
endfunction()