diff --git a/src/native/corehost/apphost/static/CMakeLists.txt b/src/native/corehost/apphost/static/CMakeLists.txt index 0d9ae541c33b1d..a00c79139863fb 100644 --- a/src/native/corehost/apphost/static/CMakeLists.txt +++ b/src/native/corehost/apphost/static/CMakeLists.txt @@ -110,6 +110,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) @@ -130,6 +133,7 @@ if(CLR_CMAKE_TARGET_WIN32) shell32.lib bcrypt.lib RuntimeObject.lib + delayimp.lib ) set(RUNTIMEINFO_LIB runtimeinfo)