From f30204e21cadc196575bde2b23280018bf6b238e Mon Sep 17 00:00:00 2001 From: NN <580536+NN---@users.noreply.github.com> Date: Wed, 29 Dec 2021 19:19:13 +0200 Subject: [PATCH] Delay load winrt --- src/native/corehost/apphost/static/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/native/corehost/apphost/static/CMakeLists.txt b/src/native/corehost/apphost/static/CMakeLists.txt index d9c92506635a69..b331d74d7ee382 100644 --- a/src/native/corehost/apphost/static/CMakeLists.txt +++ b/src/native/corehost/apphost/static/CMakeLists.txt @@ -107,6 +107,9 @@ if(CLR_CMAKE_TARGET_WIN32) # Incremental linking results in the linker inserting extra padding and routing function calls via thunks that can break the # invariants (e.g. size of region between Jit_PatchedCodeLast-Jit_PatchCodeStart needs to fit in a page). add_linker_flag("/INCREMENTAL:NO") + + # Delay load libraries required for WinRT as that is not supported on all platforms + add_linker_flag("/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll") endif() if(CLR_CMAKE_TARGET_WIN32) @@ -127,6 +130,7 @@ if(CLR_CMAKE_TARGET_WIN32) shell32.lib bcrypt.lib RuntimeObject.lib + delayimp.lib ) set(RUNTIMEINFO_LIB runtimeinfo)