OSDN Git Service

Enable Spectre mitigations on MSVC
authorStarg <starg@users.osdn.me>
Sat, 20 Jan 2018 09:18:27 +0000 (18:18 +0900)
committerStarg <starg@users.osdn.me>
Sat, 20 Jan 2018 09:42:04 +0000 (18:42 +0900)
CMakeLists.txt

index dab561c..e5e4678 100644 (file)
@@ -116,7 +116,7 @@ add_definitions(
 )
 
 if(MSVC)
-    add_compile_options(/W4 /Zi /GS /fp:fast /permissive-)
+    add_compile_options(/W4 /Zi /GS /fp:fast /permissive- /d2guardspecload)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /std:c++17")
 
     set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GL /guard:cf")