cmake: allow linting a specific file

For instance to only lint "edit.c"
make lint LINT_FILE="src/nvim/edit.c"
This commit is contained in:
Björn Linse 2016-02-25 11:31:34 +01:00
parent 8160e875a0
commit 5c1597cad1
1 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,11 @@ get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE)
get_filename_component(LINT_PREFIX ${LINT_DIR} PATH)
set(LINT_SUPPRESS_FILE "${LINT_PREFIX}/errors.json")
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
if(DEFINED ENV{LINT_FILE})
file(GLOB_RECURSE LINT_FILES "$ENV{LINT_FILE}")
else()
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
endif()
set(LINT_ARGS)