summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c45c8723df..1da3550a6f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -431,6 +431,13 @@ if (WIN32)
add_compile_options($<$<CONFIG:Debug>:/homeparams>) # Force parameters passed in registers to be written to the stack
endif (CLR_CMAKE_PLATFORM_ARCH_AMD64)
+ if(NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ # enable control-flow-guard support for native components for non-Arm64 builds
+ add_compile_options(/guard:cf)
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf")
+ endif (NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
+
# Linker flags
#
# Disable the following line for UNIX altjit on Windows