File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,11 @@ IF (MSVC)
137137 # /Gd - explicitly set cdecl calling convention
138138 SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd" )
139139
140+ IF (NOT (MSVC_VERSION LESS 1900))
141+ # /guard:cf - Enable Control Flow Guard
142+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf" )
143+ ENDIF ()
144+
140145 IF (STATIC_CRT)
141146 SET (CRT_FLAG_DEBUG "/MTd" )
142147 SET (CRT_FLAG_RELEASE "/MT" )
@@ -183,6 +188,11 @@ IF (MSVC)
183188 # /VERSION - Embed version information in PE header
184189 SET (CMAKE_EXE_LINKER_FLAGS "/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /VERSION:${LIBGIT2_VERSION_MAJOR} .${LIBGIT2_VERSION_MINOR} " )
185190
191+ IF (NOT (MSVC_VERSION LESS 1900))
192+ # /GUARD:CF - Enable Control Flow Guard
193+ SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /GUARD:CF" )
194+ ENDIF ()
195+
186196 # /DEBUG - Create a PDB
187197 # /LTCG - Link time code generation (whole program optimization)
188198 # /OPT:REF /OPT:ICF - Fold out duplicate code at link step
You can’t perform that action at this time.
0 commit comments