Add a cast to squelch a warning.
[metze/wireshark/wip.git] / CMakeLists.txt
index 120d03c959a0dc4e89d6e66b2d864f60bcaae5c7..2f023677e49556ee7ba2960edcdc1726223dd6cf 100644 (file)
@@ -124,56 +124,53 @@ set(WIRESHARK_C_FLAGS
        -Wendif-labels
        -Wpointer-arith
        -Warray-bounds
-       -Wcast-align
        -Wformat-security
-       -fexcess-precision=fast
+       -Wshorten-64-to-32
+       -Wvla
+       -Waddress
+       -Warray-bounds
+       -Wattributes
+       -Wdiv-by-zero
+       -Wignored-qualifiers
+       -Wpragmas
+       -Wno-overlength-strings
+       -Wwrite-strings
+       -Wno-long-long
 )
+if (NOT APPLE)
+       set(WIRESHARK_C_FLAGS ${WIRESHARK_C_FLAGS} -fexcess-precision=fast)
+endif()
 
 set(WIRESHARK_C_ONLY_FLAGS
        # The following are C only, not C++
        -Wc++-compat
        -Wdeclaration-after-statement
+       -Wlogical-op
+       -Wshadow
        -Wno-pointer-sign
        -Wold-style-definition
        -Wshadow
+       -Wstrict-prototypes
+       -Wjump-misses-init
 )
 
 set(WIRESHARK_EXTRA_C_FLAGS
        -pedantic
        -Woverflow
-       -Wlogical-op
-       -Wno-overlength-strings
        -fstrict-overflow -Wstrict-overflow=4
        -Wunreachable-code
        -Wunsafe-loop-optimizations
-       -Wno-long-long
+       -Wcast-align
        -Wcast-qual
-       -Waddress
-       -Warray-bounds
-       -Wattributes
-       -Wdiv-by-zero
        -Wformat-security
-       -Wignored-qualifiers
-       -Wpragmas
        -Wredundant-decls
-       -Wvla
-       # packet-ncp2222.inc prevents this from going into all warnings
-       -Wwrite-strings
        # All the registration functions block these for now.
        -Wmissing-declarations
-       # Problem with packet-afs.c
-       -Wshadow
-       # More cleanup needed for this on LP64
-       -Wshorten-64-to-32
-
 )
 
 set(WIRESHARK_EXTRA_C_ONLY_FLAGS
        # The following are C only, not C++
        -Wbad-function-cast
-       -Wjump-misses-init
-       # GLib blocks this for now.
-       -Wstrict-prototypes
        # All the registration functions block these for now.
        -Wmissing-prototypes
 )
@@ -230,7 +227,7 @@ else()
        unset(WERROR)
 endif()
 
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER MATCHES ".*clang")
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER MATCHES ".*clang" OR APPLE)
        set (C_UNUSED "__attribute__((unused))" )
 else()
        set (C_UNUSED "" )
@@ -628,7 +625,7 @@ ADD_CUSTOM_COMMAND(
 
 if(UNIX)
        set(PLATFORM_SRC
-               capture-pcap-util-unix.c capture_unix_ifnames.c
+               capture-pcap-util-unix.c
        )
 endif()
 
@@ -662,9 +659,6 @@ set(WIRESHARK_COMMON_SRC
        ps.c
        svnversion.h
        sync_pipe_write.c
-       timestats.c
-       tap-megaco-common.c
-       tap-rtp-common.c
        version_info.c
 )
 
@@ -784,7 +778,6 @@ if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
                merge.c
                proto_hier_stats.c
                summary.c
-               tempfile.c
                u3.c
                ws80211_utils.c
                ${SHARK_COMMON_CAPTURE_SRC}
@@ -845,6 +838,7 @@ register_tap_files(tshark-tap-register.c
 
 if(BUILD_tshark)
        set(tshark_LIBS
+               ui
                ${LIBEPAN_LIBS}
                ${APPLE_CORE_FOUNDATION_LIBRARY}
                ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
@@ -852,10 +846,8 @@ if(BUILD_tshark)
        set(tshark_FILES
                capture_opts.c
                capture_sync.c
-               tempfile.c
                tshark-tap-register.c
                tshark.c
-               ui/util.c
                ${TSHARK_TAP_SRC}
                ${SHARK_COMMON_CAPTURE_SRC}
                ${WIRESHARK_COMMON_SRC}
@@ -1003,7 +995,6 @@ if(BUILD_editcap)
        set(editcap_FILES
                editcap.c
                epan/crypt/md5.c
-               epan/nstime.c
                ${WTAP_PLUGIN_SOURCES}
        )
        add_executable(editcap ${editcap_FILES})
@@ -1040,7 +1031,6 @@ if(BUILD_dumpcap AND PCAP_FOUND)
                pcapio.c
                ringbuffer.c
                sync_pipe_write.c
-               tempfile.c
                version_info.c
                ws80211_utils.c
                ${PLATFORM_SRC}