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 --- wsutil/CMakeLists.txt | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'wsutil') diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 2f71d0fc72..539126df04 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -189,33 +189,18 @@ set(CLEAN_FILES ${WSUTIL_FILES} ) -if (WERROR_COMMON_FLAGS) - set_source_files_properties( - ${CLEAN_FILES} - PROPERTIES - COMPILE_FLAGS ${WERROR_COMMON_FLAGS} - ) -else() - # - # Set the property to an empty string, so that if we try - # to get it below, it succeeds. - # - set_source_files_properties( - ${CLEAN_FILES} - PROPERTIES - COMPILE_FLAGS "" - ) -endif() +set_source_files_properties( + ${CLEAN_FILES} + PROPERTIES + COMPILE_FLAGS "${WERROR_COMMON_FLAGS}" +) if (HAVE_SSE4_2) - get_source_file_property( - WS_MEMPBRK_SSE42_COMPILE_FLAGS - ws_mempbrk_sse42.c - COMPILE_FLAGS - ) + # TODO with CMake 2.8.12, we could use COMPILE_OPTIONS and just append + # instead of this COMPILE_FLAGS duplication... set_source_files_properties( ws_mempbrk_sse42.c PROPERTIES - COMPILE_FLAGS "${WS_MEMPBRK_SSE42_COMPILE_FLAGS} ${SSE4_2_FLAG}" + COMPILE_FLAGS "${WERROR_COMMON_FLAGS} ${SSE4_2_FLAG}" ) endif() -- cgit v1.2.3