diff --git a/CMakeLists.txt b/CMakeLists.txt index 7476d5f2d..a57aebad3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ endif() ######################################################################## # Determine optional blocks/libraries to be built (default: not built) -# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ../' +# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ..' ######################################################################## # Support of optional RF front-ends option(ENABLE_UHD "Enable the use of UHD (driver for all USRP devices)" ON) @@ -58,6 +58,9 @@ option(ENABLE_RAW_UDP "Enable the use of high-optimized custom UDP packet sample option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF) option(ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF) +# Code correctness +option(ENABLE_CLANG_TIDY "Enable the use of clang-tidy when compiling" OFF) + # Acceleration option(ENABLE_PROFILING "Enable execution of volk_gnsssdr_profile at the end of the building" OFF) option(ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF) @@ -1529,8 +1532,8 @@ endif() find_package(Doxygen) if(DOXYGEN_FOUND) message(STATUS "Doxygen found.") - message(STATUS "You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") - message(STATUS "When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") + message(STATUS " You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") + message(STATUS " When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) @@ -1552,7 +1555,7 @@ if(DOXYGEN_FOUND) COMMENT "Generating API documentation with Doxygen." VERBATIM ) if(LATEX_COMPILER) - message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") + message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") add_custom_target(pdfmanual COMMAND ${CMAKE_MAKE_PROGRAM} COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf @@ -1562,7 +1565,7 @@ if(DOXYGEN_FOUND) COMMENT "Generating PDF manual with Doxygen." VERBATIM ) endif() - message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") + message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") add_custom_target(doc-clean COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex @@ -1600,7 +1603,7 @@ if(ENABLE_OPENCL) else() if(OPENCL_FOUND) message(STATUS "OpenCL has been found and will be used by some processing blocks") - message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") + message(STATUS " You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ..' ") endif() endif() if(ENABLE_GENERIC_ARCH) @@ -1627,10 +1630,10 @@ endif() if(ENABLE_CUDA) find_package(CUDA REQUIRED) message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_CUDA=OFF ..'") else() message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA.") + message(STATUS " Enable it with 'cmake -DENABLE_CUDA=ON ..' to add support for GPU-based acceleration using CUDA.") endif() @@ -1640,7 +1643,7 @@ endif() ############################################################################### if(ENABLE_RAW_UDP) message(STATUS "High-optimized custom UDP IP packet source is enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ..'") find_package(PCAP) if(NOT PCAP_FOUND) message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (with ENABLE_RAW_UDP=ON)") @@ -1654,10 +1657,10 @@ endif() ############################################################################### if(ENABLE_FPGA) message(STATUS "FPGA Acceleration will be enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_FPGA=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_FPGA=OFF ..'") else() message(STATUS "Fpga Acceleration will be not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA.") + message(STATUS " Enable it with 'cmake -DENABLE_FPGA=ON ..' to add support for GPU-based acceleration using the FPGA.") endif() @@ -1707,7 +1710,7 @@ if(ENABLE_OSMOSDR) find_package(GROSMOSDR) if(GROSMOSDR_FOUND) message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ..'") else() if(ENABLE_PACKAGING) message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") @@ -1717,7 +1720,7 @@ if(ENABLE_OSMOSDR) endif() else() message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") + message(STATUS " Enable it with 'cmake -DENABLE_OSMOSDR=ON ..' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") endif() @@ -1755,10 +1758,10 @@ endif() if(ENABLE_FLEXIBAND) message(STATUS "The Teleorbit Flexiband front-end source will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ..'") else() message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end.") + message(STATUS " Enable it with 'cmake -DENABLE_FLEXIBAND=ON ..' to add support for the Teleorbit Flexiband front-end.") endif() if(ENABLE_FLEXIBAND) find_package(TELEORBIT) @@ -1780,11 +1783,11 @@ if(GN3S_DRIVER) endif() if(ENABLE_GN3S) message(STATUS "The GN3S driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_GN3S=OFF ..'") find_package(GRGN3S QUIET) else() message(STATUS "The (optional and experimental) GN3S driver is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") + message(STATUS " Enable it with 'cmake -DENABLE_GN3S=ON ..' to add support for the GN3S dongle.") endif() @@ -1802,11 +1805,11 @@ endif() if(ENABLE_ARRAY) message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_ARRAY=OFF ..'") find_package(GRDBFCTTC QUIET) else() message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end.") + message(STATUS " Enable it with 'cmake -DENABLE_ARRAY=ON ..' to add support for the CTTC experimental array front-end.") endif() @@ -1818,11 +1821,11 @@ if(ENABLE_GPERFTOOLS) find_package(GPERFTOOLS) if(NOT GPERFTOOLS_FOUND) message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") - message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") - message(STATUS "You can install GPerftools from https://github.com/gperftools/gperftools") + message(STATUS " Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") + message(STATUS " You can install GPerftools from https://github.com/gperftools/gperftools") else() message(STATUS "GPerftools libraries found.") - message(STATUS "Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") + message(STATUS " Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") endif() endif() if(ENABLE_GPERFTOOLS) @@ -1900,7 +1903,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") message(STATUS "clang-tidy not found.") else() message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") - set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*") + if(ENABLE_CLANG_TIDY) + message(STATUS " clang-tidy will be used in compilation. You can disable it with 'cmake -DENABLE_CLANG_TIDY=OFF ..'") + else() + message(STATUS " You can enable clang-tidy usage in compilation with 'cmake -DENABLE_CLANG_TIDY=ON ..'") + endif() + set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-fix") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) endif() endif() diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index 60dba0590..954d057bc 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -49,6 +49,15 @@ if(Boost_VERSION LESS 105800) target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET pvt_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index 9a426daf6..6c36caa24 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -41,6 +41,15 @@ target_link_libraries(pvt_gr_blocks core_system_parameters ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + target_include_directories(pvt_gr_blocks PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index a19859234..d04fa0cb5 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -79,6 +79,15 @@ target_include_directories(pvt_libs target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET pvt_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ $ diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index c6285d699..bfe54fa8e 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -110,6 +110,15 @@ target_include_directories(acquisition_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET acquisition_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index e0db64422..5a135364b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -94,6 +94,15 @@ if(OPENCL_FOUND) target_include_directories(acquisition_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS}) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET acquisition_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index 678cb5f2d..4b8eefec8 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -45,6 +45,15 @@ target_link_libraries(acquisition_libs core_system_parameters ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET acquisition_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index 14bc0f16b..7bf49e73d 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -41,6 +41,15 @@ target_include_directories(channel_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(channel_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET channel_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 7a6582046..c055123bc 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -43,6 +43,15 @@ target_link_libraries(channel_libs core_receiver ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(channel_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET channel_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index 92f967849..6e0e68a45 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -47,6 +47,15 @@ target_include_directories(conditioner_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(conditioner_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET conditioner_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 39a4c7216..a9042d832 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -63,6 +63,15 @@ target_include_directories(data_type_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(data_type_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET data_type_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 9201bcc79..f1709bf7f 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -64,6 +64,15 @@ if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(input_filter_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET input_filter_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index 682c1f01b..72cb7962c 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -51,6 +51,15 @@ target_link_libraries(input_filter_gr_blocks Log4cpp::log4cpp ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(input_filter_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET input_filter_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 32c8a876e..78878897b 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -148,6 +148,15 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(algorithms_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + ############################################################################### source_group(Headers FILES gnss_sdr_flags.h) @@ -169,6 +178,15 @@ target_compile_definitions(gnss_sdr_flags PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(gnss_sdr_flags + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET gnss_sdr_flags APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index 78d5c0b98..a75cd92df 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -43,6 +43,15 @@ target_link_libraries(obs_adapters Glog::glog ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(obs_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET obs_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index d1fb176eb..e50fabfd2 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -46,6 +46,15 @@ target_link_libraries(obs_gr_blocks algorithms_libs ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(obs_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET obs_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 58d7e2099..18554d352 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -56,6 +56,15 @@ if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") target_compile_definitions(resampler_adapters PUBLIC -DGR_GREATER_38=1) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(resampler_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET resampler_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 5b4c38b99..e5193d7eb 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -48,6 +48,15 @@ target_link_libraries(resampler_gr_blocks Glog::glog ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(resampler_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET resampler_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index 8797cb514..fb651871e 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -29,7 +29,7 @@ add_library(signal_generator_adapters target_link_libraries(signal_generator_adapters PUBLIC Gnuradio::blocks - signal_generator_blocks + signal_generator_gr_blocks PRIVATE Gflags::gflags Glog::glog @@ -41,6 +41,15 @@ target_include_directories(signal_generator_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_generator_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET signal_generator_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index 87990a094..99e7debab 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -21,12 +21,12 @@ set(SIGNAL_GENERATOR_BLOCK_HEADERS signal_generator_c.h) source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) -add_library(signal_generator_blocks +add_library(signal_generator_gr_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS} ) -target_link_libraries(signal_generator_blocks +target_link_libraries(signal_generator_gr_blocks PUBLIC Boost::boost Gnuradio::runtime @@ -36,12 +36,21 @@ target_link_libraries(signal_generator_blocks algorithms_libs ) -target_include_directories(signal_generator_blocks +target_include_directories(signal_generator_gr_blocks PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs ) -set_property(TARGET signal_generator_blocks +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_generator_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET signal_generator_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ ) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index e0233ad6f..5374a6fbf 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -253,6 +253,15 @@ target_compile_definitions(signal_source_adapters PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET signal_source_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ ) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 740bd4b8c..4a4a264d2 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -84,6 +84,15 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET signal_source_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ ) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 7f07471ea..f6015ec59 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -93,6 +93,15 @@ if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) ) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET signal_source_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ ) diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index cf8ca684d..17eb17e5d 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -67,6 +67,15 @@ target_include_directories(telemetry_decoder_adapters ${CMAKE_SOURCE_DIR}/src/core/interfaces ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET telemetry_decoder_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 6c76801de..8e71b0681 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -61,6 +61,15 @@ target_link_libraries(telemetry_decoder_gr_blocks Glog::glog ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET telemetry_decoder_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index 866c8957b..a802b970c 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -44,6 +44,15 @@ target_link_libraries(telemetry_decoder_libs Glog::glog ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET telemetry_decoder_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 34c62dfb2..e51180bf6 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -116,6 +116,15 @@ if(ENABLE_CUDA) ) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET tracking_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 3341d142a..48da0fc1b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -102,6 +102,15 @@ if(ENABLE_CUDA) ) endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET tracking_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 63ca330df..7a7951645 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -100,6 +100,15 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET tracking_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index d99d6f494..68b52890c 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -51,6 +51,15 @@ target_link_libraries(core_libs Pugixml::pugixml ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET core_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 13f13576d..4549006c4 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -44,8 +44,6 @@ target_link_libraries(core_monitor Gnuradio::runtime core_system_parameters PRIVATE - Gflags::gflags - Glog::glog Gnuradio::pmt ) @@ -58,6 +56,15 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_monitor + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET core_monitor APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index 49b609ce6..d52fb10d7 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -33,15 +33,11 @@ #include "gnss_synchro_monitor.h" #include "gnss_synchro.h" -#include #include #include #include -using google::LogMessage; - - gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, int decimation_factor, int udp_port, diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 877658b64..538f2d72a 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -168,6 +168,15 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_receiver + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET core_receiver APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ $ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 5ebb96ad0..75efbae2d 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -1051,7 +1051,7 @@ void ControlThread::sysv_queue_listener() { typedef struct { - long mtype; // required by SysV queue messaging + long mtype; // NOLINT(google-runtime-int) required by SysV queue messaging double stop_message; } stop_msgbuf; diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index bc1e89cc4..262aab718 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -117,6 +117,15 @@ target_link_libraries(core_system_parameters Gflags::gflags ) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_system_parameters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + set_property(TARGET core_system_parameters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 40f0c3ff9..ad785f0f0 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -68,6 +68,15 @@ if(OS_IS_MACOSX) endif() endif() +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(gnss-sdr + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + add_custom_command(TARGET gnss-sdr POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$ diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index f3da0060f..afe871fdd 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -701,7 +701,7 @@ if(NOT ENABLE_PACKAGING) GTest::GTest GTest::Main Volkgnsssdr::volkgnsssdr - signal_generator_blocks + signal_generator_gr_blocks signal_source_gr_blocks signal_source_libs acquisition_adapters @@ -746,7 +746,7 @@ if(NOT ENABLE_PACKAGING) signal_source_libs algorithms_libs tracking_adapters - signal_generator_blocks + signal_generator_gr_blocks core_receiver core_system_parameters )