diff --git a/.clang-tidy b/.clang-tidy index 716dd3a..4a88fa5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,14 +1,16 @@ --- -Checks: > - clang-analyzer-*, - -clang-analyzer-optin.cplusplus.VirtualCall, - clang-diagnostic-*, - google-*, - misc-*, - -misc-non-private-member-variables-in-classes, - readability-*, - -readability-identifier-length, - -readability-magic-numbers, +Checks: [ + clang-analyzer-*, + -clang-analyzer-optin.cplusplus.VirtualCall, + clang-diagnostic-*, + google-*, + misc-*, + -misc-non-private-member-variables-in-classes, + readability-*, + -readability-container-contains, # Removed for compatibility with C++17 which is used in ROS Humble + -readability-identifier-length, + -readability-magic-numbers, + ] CheckOptions: misc-include-cleaner.IgnoreHeaders: bits/chrono.h @@ -23,13 +25,13 @@ CheckOptions: readability-identifier-naming.StaticConstantCase: lower_case readability-identifier-naming.StaticVariableCase: lower_case readability-identifier-naming.MacroDefinitionCase: UPPER_CASE - readability-identifier-naming.MacroDefinitionIgnoredRegexp: '^[A-Z]+(_[A-Z]+)*_$' + readability-identifier-naming.MacroDefinitionIgnoredRegexp: "^[A-Z]+(_[A-Z]+)*_$" readability-identifier-naming.PrivateMemberCase: lower_case readability-identifier-naming.ProtectedMemberCase: lower_case readability-identifier-naming.PublicMemberCase: lower_case readability-identifier-naming.PrivateMemberSuffix: _ readability-identifier-naming.ProtectedMemberSuffix: _ - readability-identifier-naming.PublicMemberSuffix: '' + readability-identifier-naming.PublicMemberSuffix: "" readability-identifier-naming.NamespaceCase: lower_case readability-identifier-naming.ParameterCase: lower_case readability-identifier-naming.TypeAliasCase: CamelCase diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67d02af..380c7c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,11 @@ jobs: ROS_DISTRO: ${{ matrix.ROS_DISTRO }} ROS_REPO: ${{ matrix.ROS_REPO }} CMAKE_ARGS: ${{ matrix.ROS_DISTRO == 'rolling' && '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_CLANG_TIDY=ON' || '' }} + # gcc-16 is installed on the rolling image alongside gcc-15 but without its + # libstdc++ headers, so clang-tidy (which auto-selects the newest GCC found) + # fails with "'chrono'/'string'/'memory' file not found". Installing + # libstdc++-16-dev fixes this. + ADDITIONAL_DEBS: ${{ matrix.ROS_DISTRO == 'rolling' && 'libstdc++-16-dev' || '' }} steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c56ab3..2875c3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) project(web_video_server) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -25,10 +25,6 @@ pkg_check_modules(avformat libavformat REQUIRED) pkg_check_modules(avutil libavutil REQUIRED) pkg_check_modules(swscale libswscale REQUIRED) -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) -endif() - ################################################### ## Declare things to be passed to other projects ## ################################################### diff --git a/src/streamers/image_transport_streamer.cpp b/src/streamers/image_transport_streamer.cpp index 54baa3f..f05eb8a 100644 --- a/src/streamers/image_transport_streamer.cpp +++ b/src/streamers/image_transport_streamer.cpp @@ -54,6 +54,7 @@ #include "image_transport/image_transport.hpp" #include "rclcpp/node.hpp" #include "rclcpp/logging.hpp" +#include "rclcpp/qos.hpp" #include "rmw/qos_profiles.h" #include "sensor_msgs/msg/image.hpp" diff --git a/src/streamers/jpeg_streamers.cpp b/src/streamers/jpeg_streamers.cpp index c0abf0f..746fb40 100644 --- a/src/streamers/jpeg_streamers.cpp +++ b/src/streamers/jpeg_streamers.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/src/streamers/png_streamers.cpp b/src/streamers/png_streamers.cpp index 3a0b832..d7a8518 100644 --- a/src/streamers/png_streamers.cpp +++ b/src/streamers/png_streamers.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/src/streamers/vp8_streamer.cpp b/src/streamers/vp8_streamer.cpp index 82f0df5..2c96063 100644 --- a/src/streamers/vp8_streamer.cpp +++ b/src/streamers/vp8_streamer.cpp @@ -36,7 +36,6 @@ extern "C" #include } -#include #include #include diff --git a/src/streamers/vp9_streamer.cpp b/src/streamers/vp9_streamer.cpp index f2b1187..e0afda1 100644 --- a/src/streamers/vp9_streamer.cpp +++ b/src/streamers/vp9_streamer.cpp @@ -35,7 +35,6 @@ extern "C" #include } -#include #include #include "async_web_server_cpp/http_connection.hpp" diff --git a/src/web_video_server.cpp b/src/web_video_server.cpp index e1d4076..968a0f0 100644 --- a/src/web_video_server.cpp +++ b/src/web_video_server.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include #include