diff options
author | Jörg Mayer <jmayer@loplof.de> | 2009-11-07 10:07:00 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2009-11-07 10:07:00 +0000 |
commit | 9ee31d1d0e9a10ddb326bc7b23c22dc99bac7f6c (patch) | |
tree | 7e19b692aaacf4e9017a30429e79626a73f71a10 /CMakeLists.txt | |
parent | f6dfb9f323f6253c8c0470b8824d8846f5c578ab (diff) |
cmake will now honor -Werror if configured (default: on)
svn path=/trunk/; revision=30852
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a6e35063f0..95e8a48505 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ option(AUTOGEN_dcerpc "Autogenerate dcerpc dissectors" OFF) option(AUTOGEN_pidl "Autogenerate pidl dissectors" OFF) option(DISABLE_WERROR "Do not treat Warnings as errors" OFF) -option(ENABLE_EXTRA_GCC_CHECKS "Do additional -W checks in GCC (disables -Werror)" ON) +option(ENABLE_EXTRA_GCC_CHECKS "Do additional -W checks in GCC (disables -Werror)" OFF) option(ENABLE_AIRPCAP "Enable Airpcap support" ON) # todo option(ENABLE_STATIC "Build a static version of Wireshark" OFF) @@ -93,7 +93,6 @@ option(ENABLE_KERBEROS "Build with Kerberos support" ON) set(WIRESHARK_C_FLAGS -O2 - -Werror -Wall -W -Wextra @@ -161,8 +160,8 @@ foreach(THIS_FLAG ${WIRESHARK_C_FLAGS}) math(EXPR C "${C} + 1") endforeach() -if(DISABLE_WERROR OR ENABLE_EXTRA_GCC_CHECKS) - remove_definitions( -Werror ) +if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_GCC_CHECKS) + check_c_compiler_flag(-Werror WERROR) endif() if(CMAKE_COMPILER_IS_GNUCC) @@ -650,6 +649,9 @@ if(BUILD_text2pcap) set(text2pcap_FILES text2pcap.c ) + set(text2pcap_CLEAN_FILES + ${text2pcap_FILES} + ) add_lex_files(text2pcap_FILES text2pcap-scanner.l ) @@ -758,6 +760,27 @@ add_custom_target( # todo: Add manpages and onlinedocs and generate them ) +set(CLEAN_FILES + ${wireshark_FILES} + ${tshark_FILES} + ${rawshark_FILES} + ${dftest_FILES} + ${randpkt_FILES} + ${text2pcap_CLEAN_FILES} + ${mergecap_FILES} + ${capinfos_FILES} + ${editcap_FILES} + ${dumpcap_FILES} +) + +if (WERROR) + set_source_files_properties( + ${CLEAN_FILES} + PROPERTIES + COMPILE_FLAGS -Werror + ) +endif() + install( FILES ${INSTALL_FILES} |