Fix linker GUARD option (#11492)
authorJan Vorlicek <janvorli@microsoft.com>
Thu, 8 Jun 2017 10:54:18 +0000 (12:54 +0200)
committerGitHub <noreply@github.com>
Thu, 8 Jun 2017 10:54:18 +0000 (12:54 +0200)
I have found that the /GUARD:CF option set in the root CMakeFiles.txt
was not being propagated to the Visual C++ project files generated
by cmake because of a wrong casing. The CMakeFiles.txt used /guard:cf
but it works correctly only if it is all upper case.

CMakeLists.txt

index 365133c..b85f30b 100644 (file)
@@ -313,8 +313,8 @@ if (WIN32)
     endforeach (Definition)
   endforeach (Config)
 
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /GUARD:CF")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /GUARD:CF")
 
   # Linker flags
   #