Browse Source

Enable control flow guard (#4457)

Helena Kotas 3 years ago
parent
commit
d3c7fac3c4
1 changed files with 7 additions and 0 deletions
  1. 7 0
      CMakeLists.txt

+ 7 - 0
CMakeLists.txt

@@ -105,6 +105,13 @@ endif()
 if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND WIN32)
   add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO)
 endif()
+
+# enable control flow guard
+if(WIN32)
+add_compile_options(/guard:cf)
+add_link_options(/guard:cf)
+endif(WIN32)
+
 # HLSL Change Ends
 
 # HLSL Change Starts - set flag for Appveyor CI