diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-04-30 16:14:26 +0200 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2018-05-02 23:02:46 +0000 |
commit | e7cd78d4b3c62aaf93205d575178e6b3b06074c1 (patch) | |
tree | 45cb0aca2392a3c6bca1a5ed1d770339d4680770 | |
parent | 30c0d7ba4970d2ccc77514afdcdbf5a86b8866a2 (diff) |
CMake: check for /Qspectre before using it
The linked blog entry for /Qspectre suggests intention to include
/Qspectre support for VS 2015 Update 3, but this has not happened yet
(at least, not with VS Community 2015 14.0.23107.178).
Change-Id: I001c8fa512457f1edc753b460634f13d2ff0ed7a
Fixes: v2.5.1rc0-611-g0ebcd27377 ("Trust CMake's Visual C++ version detection.")
Reviewed-on: https://code.wireshark.org/review/27225
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a9d9a1116..1404cbc8f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -336,8 +336,10 @@ if( CMAKE_C_COMPILER_ID MATCHES "MSVC") # https://gitlab.kitware.com/cmake/cmake/commit/f973d49ab9d4c59b93f6dac812a94bb130200836 # /Qspectre Speculative execution attack mitigation # See https://blogs.msdn.microsoft.com/vcblog/2018/01/15/spectre-mitigations-in-msvc/ - list(APPEND LOCAL_CFLAGS /Zo /utf-8 /guard:cf /Qspectre) + list(APPEND LOCAL_CFLAGS /Zo /utf-8 /guard:cf) set(WS_LINK_FLAGS "${WS_LINK_FLAGS} /guard:cf") + # /Qspectre is not available for VS2015 or older VS2017. Test for its availability. + set(WIRESHARK_COMMON_FLAGS /Qspectre) endif() if(ENABLE_CODE_ANALYSIS) |