forked from OSchip/llvm-project
cmake: Add target to reformat with clang-format
Calling 'make polly-update-format' will format all Polly files with clang-format. llvm-svn: 181293
This commit is contained in:
parent
75b8cdee19
commit
d0fe8371bf
|
@ -165,3 +165,6 @@ list( REMOVE_ITEM files ${jsonfiles} )
|
|||
add_custom_command( OUTPUT formatting COMMAND
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/utils/check_format.sh ${files})
|
||||
add_custom_target(polly-check-format DEPENDS formatting)
|
||||
add_custom_command( OUTPUT formatting-update COMMAND
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/utils/update_format.sh ${files})
|
||||
add_custom_target(polly-update-format DEPENDS formatting-update)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
if ! which clang-format; then
|
||||
echo "Error: cannot find clang-format in your path"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for ARG in "$@"
|
||||
do
|
||||
clang-format -i $ARG
|
||||
done
|
Loading…
Reference in New Issue