Commit 2e23b506 authored by Graham Bloice's avatar Graham Bloice

Add checkAPI calls to CMake.

This generates a top level target, checkAPI, that is
excluded from the ALL build target, so must be run separately.

On Windows using a Visual Studio generator, call
msbuild /p:Configuration=RelWithDebInfo checkAPI.vcxproj

Change-Id: I44a57c564dcfc75499463b942436f4b920a82478
Reviewed-on: https://code.wireshark.org/review/14873Tested-by: default avatarPetri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: default avatarGraham Bloice <graham.bloice@trihedral.com>
parent 231f6b50
......@@ -1017,6 +1017,15 @@ test_big_endian(WORDS_BIGENDIAN)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# The top level checkAPIs target, add before subdirectory calls so it's avaiable to all
add_custom_target(checkAPI)
set_target_properties(checkAPI
PROPERTIES
FOLDER "Auxiliary"
EXCLUDE_FROM_ALL True
EXCLUDE_FROM_DEFAULT_BUILD True
)
add_subdirectory( capchild )
add_subdirectory( caputils )
add_subdirectory( codecs )
......@@ -2166,10 +2175,10 @@ if(BUILD_text2pcap)
${text2pcap_CLEAN_FILES}
${CMAKE_BINARY_DIR}/image/text2pcap.rc
)
add_lex_files(text2pcap_FILES
add_lex_files(text2pcap_LEX_FILES text2pcap_GENERATED_FILES
text2pcap-scanner.l
)
add_executable(text2pcap ${text2pcap_FILES})
add_executable(text2pcap ${text2pcap_FILES} ${text2pcap_GENERATED_FILES})
add_dependencies(text2pcap version)
set_extra_executable_properties(text2pcap "Executables")
target_link_libraries(text2pcap ${text2pcap_LIBS})
......@@ -2380,7 +2389,7 @@ if(ENABLE_EXTCAP AND BUILD_sshdump AND LIBSSH_FOUND)
${LIBSSH_LIBRARIES}
)
if (WIN32)
set(sshdump_LIBS wsutil ${sshdump_LIBS})
set(sshdump_LIBS wsutil ${sshdump_LIBS})
endif()
set(sshdump_FILES
extcap/sshdump.c
......@@ -2406,7 +2415,7 @@ if(ENABLE_EXTCAP AND BUILD_ciscodump AND LIBSSH_FOUND)
${LIBSSH_LIBRARIES}
)
if (WIN32)
set(ciscodump_LIBS wsutil ${ciscodump_LIBS})
set(ciscodump_LIBS wsutil ${ciscodump_LIBS})
endif()
set(ciscodump_FILES
extcap/ciscodump.c
......@@ -2553,12 +2562,6 @@ install(
PATTERN "faq.py" EXCLUDE
)
include( UseCheckAPI )
CHECKAPI(
${TSHARK_TAP_SRC}
${WIRESHARK_SRC}
)
set(CMAKE_INSTALL_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME})
configure_file("${CMAKE_MODULE_PATH}/WiresharkConfig.cmake.in" "${CMAKE_BINARY_DIR}/WiresharkConfig.cmake" @ONLY)
configure_file("${CMAKE_MODULE_PATH}/WiresharkConfigVersion.cmake.in" "${CMAKE_BINARY_DIR}/WiresharkConfigVersion.cmake" @ONLY)
......@@ -2660,6 +2663,17 @@ else ()
endif()
endif()
include( UseCheckAPI )
CHECKAPI(
NAME
main
SWITCHES
-build
SOURCES
${WIRESHARK_SRC}
${TSHARK_TAP_SRC}
)
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
......
# CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
......@@ -46,3 +47,21 @@ add_library(capchild STATIC
set_target_properties(capchild PROPERTIES
LINK_FLAGS "${WS_LINK_FLAGS}"
FOLDER "Libs")
include( UseCheckAPI )
CHECKAPI(
NAME
capchild-base
SWITCHES
-g deprecated-gtk
SOURCES
${CAPCHILD_SRC}
)
CHECKAPI(
NAME
capchild-todo
SWITCHES
-M -g deprecated-gtk-todo
SOURCES
${CAPCHILD_SRC}
)
......@@ -68,3 +68,20 @@ add_library(caputils STATIC
set_target_properties(caputils PROPERTIES
LINK_FLAGS "${WS_LINK_FLAGS}"
FOLDER "Libs")
CHECKAPI(
NAME
caputils-base
SWITCHES
-g deprecated-gtk
SOURCES
${CAPUTILS_SRC}
)
CHECKAPI(
NAME
caputils-todo
SWITCHES
-M -g deprecated-gtk-todo
SOURCES
${CAPUTILS_SRC}
)
......@@ -26,7 +26,7 @@ MARK_AS_ADVANCED(LEX_EXECUTABLE)
# flex a .l file
MACRO(ADD_LEX_FILES _sources )
MACRO(ADD_LEX_FILES _source _generated)
FOREACH (_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE)
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE)
......@@ -41,7 +41,8 @@ MACRO(ADD_LEX_FILES _sources )
${_in}
DEPENDS ${_in}
)
SET(${_sources} ${${_sources}} ${_outc} )
LIST(APPEND ${_source} ${_in})
LIST(APPEND ${_generated} ${_outc})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ENDFOREACH (_current_FILE)
......
......@@ -24,7 +24,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(YACC DEFAULT_MSG YACC_EXECUTABLE)
MARK_AS_ADVANCED(YACC_EXECUTABLE)
MACRO(ADD_YACC_FILES _sources )
MACRO(ADD_YACC_FILES _source _generated)
FOREACH (_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE)
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE)
......@@ -40,7 +40,8 @@ MACRO(ADD_YACC_FILES _sources )
${_in}
DEPENDS ${_in}
)
SET(${_sources} ${${_sources}} ${_out} )
LIST(APPEND ${_source} ${_in})
LIST(APPEND ${_generated} ${_out})
ENDFOREACH (_current_FILE)
ENDMACRO(ADD_YACC_FILES)
# Add a target to call checkAPIs.pl on the specified source files
# The target is excluded from the ALL targte so must be manually
# specified in a build command.
# The target is added to the top-level checkAPIs target
#
# Parameters:
# NAME: The name of the target, must be unique
# SWITCHES: Switches to be supplied to the script
# SOURCES: The sources to be checked
include(CMakeParseArguments)
macro( CHECKAPI )
set( _sources ${ARGN} )
cmake_parse_arguments(CHECKAPI "DEBUG" "" "NAME;SWITCHES;SOURCES" ${ARGN} )
if (CHECKAPI_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "CHECKAPIS Unknown argument: ${CHECKAPI_UNPARSED_ARGUMENTS}")
endif()
ADD_CUSTOM_TARGET(checkapi
if( CHECKAPI_DEBUG )
set (CHECKAPI_SWITCHES ${CHECKAPI_SWITCHES --debug)
endif()
set(TARGET_NAME checkAPI_${CHECKAPI_NAME})
add_custom_target(${TARGET_NAME}
COMMAND ${PERL_EXECUTABLE}
${CMAKE_SOURCE_DIR}/tools/checkAPIs.pl
-build
${_sources}
${CHECKAPI_SWITCHES}
${CHECKAPI_SOURCES}
WORKING_DIRECTORY
${CMAKE_SOURCE_DIR}
DEPENDS
${CMAKE_SOURCE_DIR}/tools/checkAPIs.pl
${_sources}
${CMAKE_CURRENT_SOURCE_DIR}
COMMENT
"Running ${TARGET_NAME}"
)
add_dependencies(checkAPI ${TARGET_NAME})
set_target_properties(${TARGET_NAME}
PROPERTIES FOLDER "Auxiliary/CheckAPIs"
EXCLUDE_FROM_ALL True
EXCLUDE_FROM_DEFAULT_BUILD True
)
set_target_properties(checkapi PROPERTIES FOLDER "Auxiliary")
ENDMACRO()
#
MACRO(ADD_LEMON_FILES _sources )
MACRO(ADD_LEMON_FILES _source _generated)
set(_lemonpardir ${CMAKE_SOURCE_DIR}/tools/lemon)
FOREACH (_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE)
......@@ -22,6 +22,7 @@ MACRO(ADD_LEMON_FILES _sources )
${_lemonpardir}/lempar.c
)
SET(${_sources} ${${_sources}} ${_out}.c )
LIST(APPEND ${_source} ${_in})
LIST(APPEND ${_generated} ${_out}.c)
ENDFOREACH (_current_FILE)
ENDMACRO(ADD_LEMON_FILES)
......@@ -81,3 +81,12 @@ if(NOT ${ENABLE_STATIC})
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
CHECKAPI(
NAME
codecs
SWITCHES
-g abort -g termoutput -build
SOURCES
${WSCODECS_FILES}
)
......@@ -175,7 +175,7 @@ set(LIBWIRESHARK_CLEAN_FILES
${LIBWIRESHARK_FILES}
)
add_lex_files(LIBWIRESHARK_FILES
add_lex_files(LEX_FILES GENERATED_FILES
diam_dict.l
dtd_parse.l
dtd_preparse.l
......@@ -183,7 +183,7 @@ add_lex_files(LIBWIRESHARK_FILES
uat_load.l
)
add_lemon_files(LIBWIRESHARK_FILES
add_lemon_files(LEMON_FILES GENERATED_FILES
dtd_grammar.lemon
)
......@@ -219,6 +219,7 @@ endif()
add_library(epan ${LINK_MODE_LIB}
${LIBWIRESHARK_FILES}
${GENERATED_FILES}
${COMPRESS_FILES}
${LIBWIRESHARK_ASM_FILES}
$<TARGET_OBJECTS:crypt>
......@@ -341,6 +342,18 @@ set_target_properties(tvbtest PROPERTIES
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
# Commented out as per nmake
#CHECKAPI(
# NAME
# epan
# SWITCHES
# -g termoutput -build
# SOURCES
# ${LIBWIRESHARK_FILES}
# ${LEX_FILES}
# ${LEMON_FILES}
#)
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
......
......@@ -53,6 +53,15 @@ set_target_properties(crypt PROPERTIES
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
CHECKAPI(
NAME
crypt
SWITCHES
-g termoutput -build
SOURCES
${CRYPT_FILES}
)
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
......
......@@ -51,16 +51,17 @@ if(WERROR_COMMON_FLAGS)
)
endif()
add_lex_files(DFILTER_FILES
add_lex_files(LEX_FILES GENERATED_FILES
scanner.l
)
add_lemon_files(DFILTER_FILES
add_lemon_files(LEMON_FILES GENERATED_FILES
grammar.lemon
)
add_library(dfilter OBJECT
${DFILTER_FILES}
${GENERATED_FILES}
)
set_target_properties(dfilter PROPERTIES
......@@ -68,6 +69,18 @@ set_target_properties(dfilter PROPERTIES
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
CHECKAPI(
NAME
dfilter
SWITCHES
-g termoutput -build
SOURCES
${DFILTER_FILES}
# LEX files commented out due to use of malloc, free etc.
# ${LEX_FILES}
${LEMON_FILES}
)
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
......
......@@ -984,7 +984,6 @@ set(DISSECTOR_SRC
packet-ncp-nmas.c
packet-ncp-sss.c
packet-ncp.c
packet-ncp2222.c
packet-ncs.c
packet-ndmp.c
packet-ndp.c
......@@ -1428,10 +1427,15 @@ set(DISSECTOR_SRC
set(DISSECTOR_SUPPORT_SRC
packet-dcerpc-nt.c
usb.c
register.c
)
source_group(dissector-support FILES ${DISSECTOR_SUPPORT_SRC})
set(DISSECTOR_GENERATED_FILES
packet-ncp2222.c
register.c
)
source_group(dissector-generated FILES ${DISSECTOR_GENERATED_FILES})
set(DISSECTOR_FILES
${DISSECTOR_SRC}
${PIDL_DISSECTOR_SRC}
......@@ -1454,6 +1458,7 @@ set(CLEAN_FILES
${PIDL_DISSECTOR_SRC}
${ASN1_DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_GENERATED_FILES}
)
if(WERROR_COMMON_FLAGS)
......@@ -1467,6 +1472,7 @@ endif()
add_library(dissectors OBJECT
${DISSECTOR_FILES}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_GENERATED_FILES}
)
set_target_properties(dissectors PROPERTIES
......@@ -1474,6 +1480,19 @@ set_target_properties(dissectors PROPERTIES
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
set(CHECKAPI_FILE_LIST "${CMAKE_CURRENT_BINARY_DIR}/files.txt")
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
file(WRITE "${CHECKAPI_FILE_LIST}" "${DISSECTOR_FILES}")
CHECKAPI(
NAME
dissectors
SWITCHES
-g abort -g termoutput -build --file ${CHECKAPI_FILE_LIST}
SOURCES
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
)
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
......
......@@ -58,6 +58,16 @@ set_target_properties(ftypes PROPERTIES
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
# Commented out as per nmake
#CHECKAPI(
# NAME
# ftypes
# SWITCHES
# -g termoutput -build
# SOURCES
# ${FTYPE_FILES}
#)
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
......
......@@ -166,6 +166,15 @@ set_target_properties(wslua PROPERTIES
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
CHECKAPI(
NAME
wslua
SWITCHES
-g termoutput -build
SOURCES
${WSLUA_FILES}
)
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
......
......@@ -104,3 +104,14 @@ install(TARGETS docsis
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
docsis
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)
......@@ -65,3 +65,14 @@ install(TARGETS ethercat
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
ethercat
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)
......@@ -59,3 +59,14 @@ install(TARGETS gryphon
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
gryphon
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)
......@@ -61,3 +61,14 @@ install(TARGETS irda
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
irda
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)
......@@ -65,3 +65,15 @@ install(TARGETS m2m
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
m2m
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
)
......@@ -40,11 +40,10 @@ set(DISSECTOR_SUPPORT_CLEAN_SRC
${DISSECTOR_SUPPORT_SRC}
)
add_lemon_files(DISSECTOR_SUPPORT_SRC
add_lemon_files(LEMON_FILES GENERATED_FILES
mate_grammar.lemon
)
add_lex_files(DISSECTOR_SUPPORT_SRC
add_lex_files(LEX_FILES GENERATED_FILES
mate_parser.l
)
......@@ -52,6 +51,7 @@ set(PLUGIN_FILES
plugin.c
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${GENERATED_FILES}
)
set(CLEAN_FILES
......@@ -81,3 +81,18 @@ install(TARGETS mate
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
mate
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
# LEX files commented out due to use of malloc, free etc.
# ${LEX_FILES}
${LEMON_FILES}
)
......@@ -75,3 +75,15 @@ install(TARGETS opcua
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
opcua
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
)
......@@ -72,3 +72,15 @@ install(TARGETS profinet
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
profinet
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
)
......@@ -48,3 +48,14 @@ install(TARGETS stats_tree
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB PLUGIN_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
stats_tree
SWITCHES
-g abort -g termoutput -build
SOURCES
${CLEAN_FILES}
${PLUGIN_HEADERS}
)
......@@ -59,3 +59,14 @@ install(TARGETS unistim
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
unistim
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)
......@@ -105,3 +105,15 @@ install(TARGETS wimax
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
wimax
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
)
......@@ -45,9 +45,10 @@ if (WERROR_COMMON_FLAGS)
)
endif()
add_lex_files(PLUGIN_FILES
add_lex_files(LEX_FILES GENERATED_FILES
wimaxasncp_dict.l
)
list(APPEND PLUGIN_FILES ${GENERATED_FILES})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
......@@ -63,3 +64,16 @@ install(TARGETS wimaxasncp
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
wimaxasncp
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
# LEX files commented out due to use of malloc, free etc.
# ${LEX_FILES}
)
......@@ -59,3 +59,14 @@ install(TARGETS wimaxmacphy
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}
)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
wimaxmacphy
SWITCHES
-g abort -g termoutput -build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)
......@@ -36,7 +36,7 @@ if (WERROR_COMMON_FLAGS)
)
endif()
file(GLOB RANDPKT_CORE_HEADERS randpkt_core.h)
file(GLOB RANDPKT_CORE_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" randpkt_core.h)
add_library(randpkt_core STATIC
${RANDPKT_CORE_SRC}
......@@ -45,3 +45,22 @@ add_library(randpkt_core STATIC
set_target_properties(randpkt_core PROPERTIES
LINK_FLAGS "${WS_LINK_FLAGS}"
FOLDER "Libs")
CHECKAPI(
NAME
randpkt_core-base
SWITCHES
-g deprecated-gtk
SOURCES
${RANDPKT_CORE_SRC}
${RANDPKT_CORE_HEADERS}
)
CHECKAPI(
NAME
randpkt_core-todo
SWITCHES
-M -g deprecated-gtk-todo
SOURCES
${RANDPKT_CORE_SRC}
${RANDPKT_CORE_HEADERS}
)
......@@ -1832,7 +1832,9 @@ sub print_usage
print " [--build] [-s group1] [-s group2] ... \n";
print " [--sourcedir=srcdir] \n";
print " [--nocheck-value-string-array] \n";
print " [--nocheck-addtext] [--nocheck-hf] [--debug] file1 file2 ...\n";
print " [--nocheck-addtext] [--nocheck-hf] [--debug]\n";
print " [--file=/path/to/file_list]\n";
print " file1 file2 ...\n";
print "\n";
print " -M: Generate output for -g in 'machine-readable' format\n";
print " -p: used by the git pre-commit hook\n";
......@@ -1976,6 +1978,7 @@ my $check_addtext = 1; # default: enabled
my $debug_flag = 0; # default: disabled
my $buildbot_flag = 0;
my $source_dir = "";
my $filenamelist = "";
my $help_flag = 0;
my $pre_commit = 0;
......@@ -1990,6 +1993,7 @@ my $result = GetOptions(
'sourcedir=s' => \$source_dir,
'debug' => \$debug_flag,
'pre-commit' => \$pre_commit,
'file=s' => \$filenamelist,
'help' => \$help_flag
);
if (!$result || $help_flag) {
......@@ -2016,11 +2020,23 @@ for my $apiGroup (keys %APIs) {
@{$APIs{$apiGroup}->{function_counts}}{@functions} = (); # Add fcn names as keys to the anonymous hash
}
my @filelist;
push @filelist, @ARGV;
if ("$filenamelist" ne "") {
# We have a file containing a list of files to check (possibly in
# addition to those on the command line).
open(FC, $filenamelist) || die("Couldn't open $filenamelist");
while (<FC>) {
# file names can be separated by ;