Move merge.{h,c} into wiretap: these modules use wiretap to merge files.
[metze/wireshark/wip.git] / CMakeLists.txt
index 5acc1e4cbcce9b463dbe938e85b04877e6557690..29f65b6e2b076f43bfb840c0d57c383e37d578b9 100644 (file)
@@ -87,6 +87,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
 INCLUDE(UseLemon)
 INCLUDE(UseMakeDissectorReg)
 INCLUDE(UseMakeTapReg)
+INCLUDE(UseAsn2Wrs)
 
 # Under linux the release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG
 
@@ -123,56 +124,57 @@ 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
+       -Wno-overlength-strings
+       -Wwrite-strings
+       -Wno-long-long
 )
+if (NOT APPLE)
+       set(WIRESHARK_C_FLAGS ${WIRESHARK_C_FLAGS}
+           -fexcess-precision=fast
+           -Wpragmas)
+endif()
 
 set(WIRESHARK_C_ONLY_FLAGS
        # The following are C only, not C++
        -Wc++-compat
        -Wdeclaration-after-statement
+       -Wshadow
        -Wno-pointer-sign
        -Wold-style-definition
        -Wshadow
+       -Wstrict-prototypes
 )
+if (NOT APPLE)
+       set(WIRESHARK_C_ONLY_FLAGS ${WIRESHARK_C_ONLY_FLAGS}
+           -Wlogical-op
+           -Wjump-misses-init)
+endif()
 
 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
 )
@@ -229,7 +231,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 "" )
@@ -614,20 +616,9 @@ ADD_CUSTOM_COMMAND(
                ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
 )
 
-ADD_CUSTOM_COMMAND(
-       OUTPUT  ps.c
-       COMMAND ${PYTHON_EXECUTABLE}
-               ${CMAKE_CURRENT_SOURCE_DIR}/tools/rdps.py
-               ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
-               ps.c
-       DEPENDS
-               ${CMAKE_CURRENT_SOURCE_DIR}/tools/rdps.py
-               ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
-)
-
 if(UNIX)
        set(PLATFORM_SRC
-               capture-pcap-util-unix.c capture_unix_ifnames.c
+               capture-pcap-util-unix.c
        )
 endif()
 
@@ -639,7 +630,6 @@ endif()
 
 set(WTAP_PLUGIN_SOURCES
        epan/plugins.c
-       epan/report_err.c
        epan/filesystem.c
 )
 
@@ -654,16 +644,9 @@ set(WIRESHARK_COMMON_SRC
        cfile.c
        cfutils.c
        clopts_common.c
-       disabled_protos.c
-       frame_data_sequence.c
-       packet-range.c
-       print.c
-       ps.c
+       frame_tvbuff.c
        svnversion.h
        sync_pipe_write.c
-       timestats.c
-       tap-megaco-common.c
-       tap-rtp-common.c
        version_info.c
 )
 
@@ -778,13 +761,9 @@ if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
                file.c
                fileset.c
                filters.c
-               g711.c
                iface_monitor.c
-               merge.c
                proto_hier_stats.c
                summary.c
-               tempfile.c
-               u3.c
                ws80211_utils.c
                ${SHARK_COMMON_CAPTURE_SRC}
                ${WIRESHARK_COMMON_SRC}
@@ -844,6 +823,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}
@@ -851,10 +831,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}
@@ -948,7 +926,6 @@ if(BUILD_mergecap)
        )
        set(mergecap_FILES
                mergecap.c
-               merge.c
                svnversion.h
                ${WTAP_PLUGIN_SOURCES}
        )
@@ -1002,7 +979,6 @@ if(BUILD_editcap)
        set(editcap_FILES
                editcap.c
                epan/crypt/md5.c
-               epan/nstime.c
                ${WTAP_PLUGIN_SOURCES}
        )
        add_executable(editcap ${editcap_FILES})
@@ -1039,7 +1015,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}