Skip to content

Commit 85daf0e

Browse files
committed
Enable compiler generation of CFG security checks
1 parent a6e69b3 commit 85daf0e

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
@@ -264,6 +264,12 @@ if (WIN32)
264264
ARCHIVE DESTINATION lib
265265
COMPONENT ${TARGET_NAME}
266266
)
267+
268+
# Enable compiler generation of Control Flow Guard security checks.
269+
target_compile_options(${TARGET_NAME} PUBLIC "/guard:cf")
270+
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
271+
LINK_FLAGS "/DYNAMICBASE /GUARD:CF")
272+
267273
elseif(UNIX)
268274
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
269275
COMPILE_DEFINITIONS LIBCOMMON_CLANG_NAME="$<TARGET_SONAME_FILE_NAME:${TARGET_NAME}>")

0 commit comments

Comments
 (0)