Skip to content

Commit 16f6202

Browse files
committed
Enable compiler generation of CFG security checks
1 parent dfd0a1e commit 16f6202

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
@@ -294,6 +294,12 @@ if (WIN32)
294294
"RC_PRODUCT_NAME=\"${RC_PRODUCT_NAME}\""
295295
"RC_PRODUCT_VERSION=\"${RC_FILE_VERSION}\""
296296
"RC_COPYRIGHT=\"Copyright ${RC_CHAR_C} 2018 Intel Corporation. All rights reserved.\"")
297+
298+
# Enable compiler generation of Control Flow Guard security checks.
299+
target_compile_options(${TARGET_NAME} PUBLIC "/guard:cf")
300+
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
301+
LINK_FLAGS "/DYNAMICBASE /GUARD:CF")
302+
297303
elseif(UNIX)
298304
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
299305
COMPILE_DEFINITIONS LIBCOMMON_CLANG_NAME="$<TARGET_SONAME_FILE_NAME:${TARGET_NAME}>")

0 commit comments

Comments
 (0)