Skip to content

Commit a74228c

Browse files
committed
Enable compiler generation of CFG security checks
1 parent 0bd125d commit a74228c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ if (WIN32)
262262
"RC_PRODUCT_NAME=\"${RC_PRODUCT_NAME}\""
263263
"RC_PRODUCT_VERSION=\"${RC_FILE_VERSION}\""
264264
"RC_COPYRIGHT=\"Copyright ${RC_CHAR_C} 2018 Intel Corporation. All rights reserved.\"")
265+
266+
# Enable compiler generation of Control Flow Guard security checks.
267+
target_compile_options(${TARGET_NAME} PUBLIC "/guard:cf")
268+
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
269+
LINK_FLAGS "/DYNAMICBASE /GUARD:CF")
270+
265271
elseif(UNIX)
266272
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
267273
LINK_FLAGS " -Wl,--no-undefined")

0 commit comments

Comments
 (0)