diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-02-25 10:24:52 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-02-25 10:24:52 -0500 |
commit | 79d30bab54cfbf7d944e7008c869bc390372fab7 (patch) | |
tree | f3990480b07e4858c9ba637bb9345f4d2d500f80 | |
parent | 3402d07abe97bb101366b491831012f9feb956b5 (diff) | |
parent | 281a9b2cea08c0e6bffd0eddd054e04c84e4ba6b (diff) | |
download | rneovim-79d30bab54cfbf7d944e7008c869bc390372fab7.tar.gz rneovim-79d30bab54cfbf7d944e7008c869bc390372fab7.tar.bz2 rneovim-79d30bab54cfbf7d944e7008c869bc390372fab7.zip |
Merge pull request #4346 from bfredl/minilint
build system: allow linting a single file and revert #4216
-rw-r--r-- | cmake/RunLint.cmake | 6 | ||||
-rwxr-xr-x | scripts/gendeclarations.lua | 31 |
2 files changed, 20 insertions, 17 deletions
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) diff --git a/scripts/gendeclarations.lua b/scripts/gendeclarations.lua index 637f4cdffa..4e74e4e301 100755 --- a/scripts/gendeclarations.lua +++ b/scripts/gendeclarations.lua @@ -239,24 +239,23 @@ end non_static = non_static .. footer static = static .. footer +local F +F = io.open(static_fname, 'w') +F:write(static) +F:close() --- Before generating the headers, check if the current file (if exists) is --- different from the new one. If they are the same, we won't touch the --- current version to avoid triggering an unnecessary rebuilds of modules +-- Before generating the non-static headers, check if the current file(if +-- exists) is different from the new one. If they are the same, we won't touch +-- the current version to avoid triggering an unnecessary rebuilds of modules -- that depend on this one -local update_changed = function (fname, contents) - local F = io.open(fname, 'r') - if F ~= nil then - if F:read('*a') == contents then - return - end - io.close(F) +F = io.open(non_static_fname, 'r') +if F ~= nil then + if F:read('*a') == non_static then + os.exit(0) end - - F = io.open(fname, 'w') - F:write(contents) - F:close() + io.close(F) end -update_changed(static_fname, static) -update_changed(non_static_fname, non_static) +F = io.open(non_static_fname, 'w') +F:write(non_static) +F:close() |