Bordeaux is a voice application server for modern IP telephony networks using modern C++ practices along with advances originally made in GNU Bayonne.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

76 lines
3.0 KiB

# Check source code
# Copyright (C) 2021 David Sugar <tychosoft@gmail.com>.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
if(lint_cxx_sources)
find_program(CLANG_TIDY_EXEC "clang-tidy")
find_program(FLAWFINDER_EXEC "flawfinder")
find_program(CPPCHECK_EXEC "cppcheck")
if(FLAWFINDER_EXEC)
add_custom_target(flaws
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND ${FLAWFINDER_EXEC} --quiet -CDF ${lint_cxx_sources}
)
endif()
if(FLAWFINDER_EXEC AND CPPCHECK_EXEC)
list(APPEND LINT_DEPENDS lint_cxx)
add_custom_target(lint_cxx
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
USES_TERMINAL
COMMAND ${FLAWFINDER_EXEC} --quiet -SCDF ${lint_cxx_sources}
COMMAND ${CPPCHECK_EXEC} --suppress="*:vendor/*" ${lint_cxx_includes} -D__cplusplus=299999 -UDEBUG --suppress=unusedStructMember --force --inline-suppr --std=c++${CMAKE_CXX_STANDARD} --quiet --enable=style,warning,performance,portability ${lint_cxx_sources}
)
elseif(FLAWFINDER_EXEC)
list(APPEND LINT_DEPENDS lint_cxx)
add_custom_target(lint_cxx
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
USES_TERMINAL
COMMAND ${FLAWFINDER_EXEC} --quiet -SCDF ${lint_cxx_sources}
)
elseif(CPPCHECK_EXEC)
list(APPEND LINT_DEPENDS lint_cxx)
add_custom_target(lint_cxx
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
USES_TERMINAL
COMMAND ${CPPCHECK_EXEC} --suppress="*:vendor/*" ${lint_cxx_includes} -D__cplusplus=299999 -UDEBUG --suppress=unusedStructMember --force --inline-suppr --std=c++${CMAKE_CXX_STANDARD} --quiet --enable=style,warning,performance,portability ${lint_cxx_sources}
)
endif()
endif()
if(lint_cxx_sources AND EXISTS ".clang-tidy" AND CLANG_TIDY_EXEC)
list(APPEND LINT_DEPENDS lint_tidy)
add_custom_target(lint_tidy
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
USES_TERMINAL
COMMAND ${CLANG_TIDY_EXEC} ${lint_cxx_sources} -quiet -- -std=c++${CMAKE_CXX_STANDARD} ${lint_cxx_includes} ${lint_tidy_includes}
)
endif()
if(EXISTS ".rubocop.yml")
find_program(RUBOCOP_EXEC "rubocop")
if(RUBOCOP_EXEC)
list(APPEND LINT_DEPENDS lint_ruby)
add_custom_target(lint_ruby
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
USES_TERMINAL
COMMAND ${RUBOCOP_EXEC}
)
endif()
endif()
if(LINT_DEPENDS)
add_custom_target(lint
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS ${LINT_DEPENDS}
)
endif()