Skip to content

Commit c9db140

Browse files
Do not attempt to use clang-format if NO_STATIC_ANALYSIS is enabled
1 parent 70e0432 commit c9db140

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

cmake/modules/Findcyphal.cmake

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,19 @@ add_project_library(
2424
)
2525

2626
find_package(clangformat)
27-
28-
if (clangformat_FOUND)
29-
30-
# define a dry-run version that we always run.
31-
enable_clang_format_check_for_directory(
32-
DIRECTORY ${LIBCYPHAL_INCLUDE}
33-
GLOB_PATTERN "**/*.hpp"
34-
ADD_TO_ALL
35-
)
36-
37-
# provide an in-place format version as a helper that must be manually run.
38-
enable_clang_format_check_for_directory(
39-
DIRECTORY ${LIBCYPHAL_INCLUDE}
40-
GLOB_PATTERN "**/*.hpp"
41-
FORMAT_IN_PLACE
42-
)
43-
27+
if (clangformat_FOUND AND NOT NO_STATIC_ANALYSIS)
28+
# define a dry-run version that we always run.
29+
enable_clang_format_check_for_directory(
30+
DIRECTORY ${LIBCYPHAL_INCLUDE}
31+
GLOB_PATTERN "**/*.hpp"
32+
ADD_TO_ALL
33+
)
34+
# provide an in-place format version as a helper that must be manually run.
35+
enable_clang_format_check_for_directory(
36+
DIRECTORY ${LIBCYPHAL_INCLUDE}
37+
GLOB_PATTERN "**/*.hpp"
38+
FORMAT_IN_PLACE
39+
)
4440
endif()
4541

4642
# +---------------------------------------------------------------------------+

0 commit comments

Comments
 (0)