diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-06-30 14:10:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 05:10:05 -0700 |
commit | 37af46bb4c351c69376f9c2947b7c3862014ee41 (patch) | |
tree | 8074d5fd442169f1bd08bb96df3a429670bebc76 /src | |
parent | f50135a32e11c535e1dc3a8e9460c5b4e640ee86 (diff) | |
download | rneovim-37af46bb4c351c69376f9c2947b7c3862014ee41.tar.gz rneovim-37af46bb4c351c69376f9c2947b7c3862014ee41.tar.bz2 rneovim-37af46bb4c351c69376f9c2947b7c3862014ee41.zip |
feat(build): add_glob_target runs only on changed files #19070
The general idea is that add_glob_targets creates a "touch file", a
dummy file that acts as a dependency in order to check which files are
outdated since the last time the target was run.
Remove RunUncrustify.cmake as it's no longer necessary. It was initially
introduced to silence its noisy output. The per-file targets will
suppress the noisy output from uncrustify, except for the very first
run.
Also remove DefCmdTarget.cmake since add_glob_target already
incorporates its functionality.
Diffstat (limited to 'src')
-rwxr-xr-x | src/nvim/CMakeLists.txt | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index a6c4bafc78..a0b8f16a39 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -1,7 +1,5 @@ option(USE_GCOV "Enable gcov support" OFF) -include(DefCmdTarget) - if(USE_GCOV) if(CLANG_TSAN) # GCOV and TSAN results in false data race reports @@ -24,7 +22,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -framework CoreServices") endif() -set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches) set(GENERATOR_DIR ${CMAKE_CURRENT_LIST_DIR}/generators) set(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/nvim/auto) set(BINARY_LIB_DIR ${PROJECT_BINARY_DIR}/lib/nvim/) @@ -800,16 +797,12 @@ foreach(sfile ${LINT_NVIM_SOURCES}) endforeach() add_custom_target(lintc DEPENDS ${LINT_TARGETS}) -def_cmd_target(lintuncrustify ${UNCRUSTIFY_PRG} UNCRUSTIFY_PRG false) -if(UNCRUSTIFY_PRG) - add_custom_command(TARGET lintuncrustify - COMMAND ${CMAKE_COMMAND} - -D UNCRUSTIFY_PRG=${UNCRUSTIFY_PRG} - -D PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} - -D NVIM_SOURCES="${NVIM_SOURCES}" - -D NVIM_HEADERS="${NVIM_HEADERS}" - -P ${PROJECT_SOURCE_DIR}/cmake/RunUncrustify.cmake) -endif() +add_glob_targets( + TARGET lintuncrustify + COMMAND ${UNCRUSTIFY_PRG} + FLAGS -c "${PROJECT_SOURCE_DIR}/src/uncrustify.cfg" -q --check + FILES ${LINT_NVIM_SOURCES} + ) add_custom_target( lintcfull |