Skip to content

Commit 111c3c5

Browse files
authored
feat: display warning if clang-format not found (#59)
1 parent a099020 commit 111c3c5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/FixFormat.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ function(target_fix_format TARGET)
2020
return()
2121
endif()
2222

23-
find_program(CLANG_FORMAT_PROGRAM clang-format REQUIRED)
23+
find_program(CLANG_FORMAT_PROGRAM clang-format)
24+
if(CLANG_FORMAT_PROGRAM STREQUAL CLANG_FORMAT_PROGRAM-NOTFOUND)
25+
message(WARNING "Cannot find the `clang-format` program required for formatting the `${TARGET}` target")
26+
return()
27+
endif()
2428

2529
# Append source files of the target to be formatted.
2630
get_target_property(TARGET_SOURCE_DIR ${TARGET} SOURCE_DIR)

0 commit comments

Comments
 (0)