Unverified Commit d08f72eb by Edward Thomson Committed by GitHub

Merge pull request #5500 from phkelley/enable-control-flow-guard

MSVC: Enable Control Flow Guard (CFG)
parents 898caead 63f9fbee
......@@ -137,6 +137,11 @@ IF (MSVC)
# /Gd - explicitly set cdecl calling convention
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
IF (NOT (MSVC_VERSION LESS 1900))
# /guard:cf - Enable Control Flow Guard
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf")
ENDIF()
IF (STATIC_CRT)
SET(CRT_FLAG_DEBUG "/MTd")
SET(CRT_FLAG_RELEASE "/MT")
......@@ -183,6 +188,11 @@ IF (MSVC)
# /VERSION - Embed version information in PE header
SET(CMAKE_EXE_LINKER_FLAGS "/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /VERSION:${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}")
IF (NOT (MSVC_VERSION LESS 1900))
# /GUARD:CF - Enable Control Flow Guard
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /GUARD:CF")
ENDIF()
# /DEBUG - Create a PDB
# /LTCG - Link time code generation (whole program optimization)
# /OPT:REF /OPT:ICF - Fold out duplicate code at link step
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment