aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2022-06-13 00:08:01 +0200
committerGitHub <noreply@github.com>2022-06-12 15:08:01 -0700
commitf90174c98cdc7af6c166043e15d178c619f83c99 (patch)
tree772ae1340aff4f426613d570d2cea17f231bbbfb /src
parent429c40cce3fce3b5391afef8208d65a80a316018 (diff)
downloadrneovim-f90174c98cdc7af6c166043e15d178c619f83c99.tar.gz
rneovim-f90174c98cdc7af6c166043e15d178c619f83c99.tar.bz2
rneovim-f90174c98cdc7af6c166043e15d178c619f83c99.zip
build(lint): fix luacheck not found #18940
Problem: Since 6d57bb89c1ee #18543, luacheck is not found on some systems when running the "lintlua" target. Solution: - Move the find_program() to the top-level CMakeLists.txt - Define a def_cmd_target() function with fewer assumptions than the old lint() function. - Move "lintuncrustify" to src/nvim/CMakeLists.txt so it can reuse the $LINT_NVIM_SOURCES already defined there. - Make the lint targets _fatal_ by default. There is little reason for the "lint" umbrella target defined in Makefile to exist if it's going to ignore the absence of the actual linters. - For now, keep the uncrustify call in a separate cmake script so that it can be silenced (too noisy).
Diffstat (limited to 'src')
-rwxr-xr-xsrc/nvim/CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index c902ff6c50..1970a68393 100755
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -1,5 +1,7 @@
option(USE_GCOV "Enable gcov support" OFF)
+include(DefCmdTarget)
+
if(USE_GCOV)
if(CLANG_TSAN)
# GCOV and TSAN results in false data race reports
@@ -802,12 +804,22 @@ foreach(sfile ${LINT_NVIM_SOURCES})
endforeach()
add_custom_target(lintc DEPENDS ${LINT_TARGETS})
+def_cmd_target(lintuncrustify ${UNCRUSTIFY_PRG} UNCRUSTIFY_PRG false) # Non-fatal so that "lintc" target can depend on it.
+if(UNCRUSTIFY_PRG)
+ add_custom_command(OUTPUT lintuncrustify-cmd APPEND
+ COMMAND ${CMAKE_COMMAND}
+ -DUNCRUSTIFY_PRG=${UNCRUSTIFY_PRG}
+ -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
+ -DLINT_NVIM_SOURCES=${LINT_NVIM_SOURCES}
+ -P ${PROJECT_SOURCE_DIR}/cmake/RunUncrustify.cmake)
+endif()
+
add_custom_target(
lintcfull
COMMAND
${LINT_PRG} --suppress-errors=${LINT_SUPPRESS_FILE} ${LINT_NVIM_REL_SOURCES}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
- DEPENDS ${LINT_PRG} ${LINT_NVIM_SOURCES} ${LINT_SUPPRESS_FILE}
+ DEPENDS ${LINT_PRG} ${LINT_NVIM_SOURCES} ${LINT_SUPPRESS_FILE} lintuncrustify
)
add_custom_target(generated-sources DEPENDS