Skip to content

Commit

Permalink
Enable compiler generation of CFG security checks
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeySotkin committed Jul 30, 2019
1 parent a090038 commit e32703f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ if (WIN32)
ARCHIVE DESTINATION lib
COMPONENT ${TARGET_NAME}
)

# Enable compiler generation of Control Flow Guard security checks.
target_compile_options(${TARGET_NAME} PUBLIC "/guard:cf")
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
LINK_FLAGS "/DYNAMICBASE /GUARD:CF")

elseif(UNIX)
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
COMPILE_DEFINITIONS LIBCOMMON_CLANG_NAME="$<TARGET_SONAME_FILE_NAME:${TARGET_NAME}>")
Expand Down

0 comments on commit e32703f

Please sign in to comment.