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)