Skip to content

Commit

Permalink
Provide --header-filter and --jobs to CMake. (#450)
Browse files Browse the repository at this point in the history
Signed-off-by: Rod <[email protected]>
  • Loading branch information
rodericktaylor authored Oct 13, 2023
1 parent 7445e4e commit 10660ec
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ament_cmake_clang_tidy/cmake/ament_clang_tidy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# @public
#
function(ament_clang_tidy)
cmake_parse_arguments(ARG "" "TESTNAME;CONFIG_FILE;TIMEOUT" "" ${ARGN})
cmake_parse_arguments(ARG "" "TESTNAME;CONFIG_FILE;TIMEOUT;HEADER_FILTER;JOBS" "" ${ARGN})
if(NOT ARG_TESTNAME)
set(ARG_TESTNAME "clang_tidy")
endif()
Expand All @@ -55,6 +55,18 @@ function(ament_clang_tidy)
list(APPEND cmd "--config" "${ament_cmake_clang_tidy_CONFIG_FILE}")
endif()

if(ARG_HEADER_FILTER)
list(APPEND cmd "--header-filter" "${ARG_HEADER_FILTER}")
elseif(DEFINED ament_cmake_clang_tidy_HEADER_FILTER)
list(APPEND cmd "--header-filter" "${ament_cmake_clang_tidy_HEADER_FILTER}")
endif()

if(ARG_JOBS)
list(APPEND cmd "--jobs" "${ARG_JOBS}")
elseif(DEFINED ament_cmake_clang_tidy_JOBS)
list(APPEND cmd "--jobs" "${ament_cmake_clang_tidy_JOBS}")
endif()

if(NOT ARG_TIMEOUT)
set(ARG_TIMEOUT 300)
endif()
Expand Down

0 comments on commit 10660ec

Please sign in to comment.