From 5c1597cad19b40803b635074d8fecf2e99c124a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Thu, 25 Feb 2016 11:31:34 +0100 Subject: [PATCH] cmake: allow linting a specific file For instance to only lint "edit.c" make lint LINT_FILE="src/nvim/edit.c" --- cmake/RunLint.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/RunLint.cmake b/cmake/RunLint.cmake index 42ef7a86ad..306e938232 100644 --- a/cmake/RunLint.cmake +++ b/cmake/RunLint.cmake @@ -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)