summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-01-06 10:44:37 -0800
committerGerald Combs <gerald@wireshark.org>2015-01-06 18:47:54 +0000
commita70929c3815a0be735119225d18645da308e51c1 (patch)
tree89aadef4b4aafed9d37416769e84916600154c33
parent087fea319aa0a4d3c0b539be2e5e687f8b3e3002 (diff)
downloadwireshark-a70929c3815a0be735119225d18645da308e51c1.tar.gz
CMake: Add an ENABLE_CODE_ANALYSIS option.
Currently Visual Studio-only. Enabling it adds /analyze:WX- to LOCAL_CFLAGS, similar to config.nmake. Change-Id: Ida68831e85f5f04b9f84faa95a39fed24e5f490d Reviewed-on: https://code.wireshark.org/review/6346 Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--CMakeLists.txt4
-rw-r--r--CMakeOptions.txt2
2 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c3952382a..e81d2b66c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,6 +196,10 @@ if( CMAKE_C_COMPILER_ID MATCHES "MSVC")
set(LOCAL_CFLAGS ${LOCAL_CFLAGS} "/D_BIND_TO_CURRENT_CRT_VERSION=1")
endif()
+ if(ENABLE_CODE_ANALYSIS)
+ set(LOCAL_CFLAGS ${LOCAL_CFLAGS} "/analyze:WX-")
+ endif()
+
# Additional compiler warnings to be treated as "Level 3"
# when compiling Wireshark sources. (Selected from "level 4" warnings).
## 4295: array is too small to include a terminating null character
diff --git a/CMakeOptions.txt b/CMakeOptions.txt
index 173eb39835..cfb0fda2ec 100644
--- a/CMakeOptions.txt
+++ b/CMakeOptions.txt
@@ -19,6 +19,8 @@ option(AUTOGEN_pidl "Autogenerate pidl dissectors" OFF)
option(DISABLE_WERROR "Do not treat warnings as errors" OFF)
option(ENABLE_EXTRA_COMPILER_WARNINGS "Do additional compiler warnings (disables -Werror)" OFF)
+option(ENABLE_CODE_ANALYSIS "Enable the compiler's static analyzer if possible" OFF)
+
#
# Leave GTK2 the default on Windows, looks better than GTK3
#