diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt index cedb910ac093ea..27f07197287994 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt @@ -158,12 +158,15 @@ add_library(eventpipe-enabled STATIC ${EVENTPIPE_SOURCES}) add_library(eventpipe-disabled STATIC ${AOT_EVENTPIPE_DISABLED_SOURCES}) if (CLR_CMAKE_TARGET_WIN32) + add_library(eventpipe-enabled.GuardCF STATIC ${EVENTPIPE_SOURCES}) add_library(eventpipe-disabled.GuardCF STATIC ${AOT_EVENTPIPE_DISABLED_SOURCES}) + target_compile_options(eventpipe-enabled.GuardCF PRIVATE $<$,$>:/guard:cf>) target_compile_options(eventpipe-disabled.GuardCF PRIVATE $<$,$>:/guard:cf>) endif (CLR_CMAKE_TARGET_WIN32) install_static_library(eventpipe-enabled aotsdk nativeaot) install_static_library(eventpipe-disabled aotsdk nativeaot) if (CLR_CMAKE_TARGET_WIN32) + install_static_library(eventpipe-enabled.GuardCF aotsdk nativeaot) install_static_library(eventpipe-disabled.GuardCF aotsdk nativeaot) endif (CLR_CMAKE_TARGET_WIN32)