From 10b1866801537e6bd51fb08feb4b786a54c48254 Mon Sep 17 00:00:00 2001 From: "Gaurav Khanna (CLR)" Date: Wed, 3 Feb 2016 15:26:04 -0800 Subject: Initial support for CFG. This makes VS 2015 as the minimum required build toolset, on Windows, for the repo. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1859ac2083..8d0aee8dd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,6 +430,13 @@ if (WIN32) add_compile_options($<$:/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 -- cgit v1.2.3