build: bundle uncrustify

Uncrustify is sensitive to version changes, which causes friction for
contributors that doesn't have that exact version. It's also simpler to
download and install the correct version than to have bespoke version
checking.
This commit is contained in:
dundargoc
2023-05-18 16:27:47 +02:00
committed by GitHub
parent c40872acbd
commit 826b95203a
7 changed files with 48 additions and 43 deletions

View File

@@ -888,18 +888,13 @@ add_glob_target(
EXCLUDE
tui/terminfo_defs.h)
add_custom_target(uncrustify-version
COMMAND ${CMAKE_COMMAND}
-D UNCRUSTIFY_PRG=${UNCRUSTIFY_PRG}
-D CONFIG_FILE=${PROJECT_SOURCE_DIR}/src/uncrustify.cfg
-P ${PROJECT_SOURCE_DIR}/cmake/CheckUncrustifyVersion.cmake)
set(UNCRUSTIFY_PRG ${DEPS_BIN_DIR}/uncrustify)
add_glob_target(
TARGET lintc-uncrustify
COMMAND ${UNCRUSTIFY_PRG}
FLAGS -c "${PROJECT_SOURCE_DIR}/src/uncrustify.cfg" -q --check
FILES ${LINT_NVIM_SOURCES})
add_dependencies(lintc-uncrustify uncrustify-version)
add_dependencies(lintc-uncrustify uncrustify)
add_custom_target(lintc)
add_dependencies(lintc lintc-clint lintc-uncrustify)
@@ -910,7 +905,7 @@ add_custom_target(formatc
-D LANG=c
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_dependencies(formatc uncrustify-version)
add_dependencies(formatc uncrustify)
add_custom_target(generated-sources DEPENDS
${NVIM_GENERATED_FOR_SOURCES}