From 534787e402d6aa8b349638f911a2a65b013c6594 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Fri, 30 Sep 2016 16:06:15 +0200 Subject: cmake: make WERROR_COMMON_FLAGS a normal string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of checking for the boolean "FALSE", just set an empty string. This avoids the need to check for WERROR_COMMON_FLAGS before using it. The transformation is the same for all files, remove "if (WERROR_COMMON_FLAGS)" and "endif()", reindent and add quotes (since we have a string here and not a list). Modelines have been added where missing. Change-Id: I0ab05ae507c51fa77336d49a99a226399cc81b92 Reviewed-on: https://code.wireshark.org/review/17997 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde Reviewed-by: Dario Lombardo Tested-by: Dario Lombardo --- CMakeLists.txt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 0530ee359e..988ca8577e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -595,10 +595,11 @@ if(ENABLE_ASAN) set(CMAKE_CXX_FLAGS "-fsanitize=address ${CMAKE_CXX_FLAGS}") endif() +set(WERROR_COMMON_FLAGS "") +set(NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS "") if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS) if(CMAKE_C_COMPILER_ID MATCHES "MSVC") set(WERROR_COMMON_FLAGS "/WX") - set(NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS) else() check_c_compiler_flag(-Werror WERROR) if (WERROR) @@ -606,8 +607,6 @@ if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS) set(NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS "-Wno-error=deprecated-declarations") endif() endif() -else() - set(WERROR_COMMON_FLAGS FALSE) endif() # @@ -2620,13 +2619,11 @@ set(CLEAN_FILES ${udpdump_FILES} ) -if (WERROR_COMMON_FLAGS) - set_source_files_properties( - ${CLEAN_FILES} - PROPERTIES - COMPILE_FLAGS ${WERROR_COMMON_FLAGS} - ) -endif() +set_source_files_properties( + ${CLEAN_FILES} + PROPERTIES + COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" +) install( FILES -- cgit v1.2.1