mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
build(lint): fix lintuncrustify #18945
Problem: lintuncrustify doesn't actually do anything. Solution: - Fix the parameters. - Fail correctly on nonzero result. followup to #18940
This commit is contained in:
parent
e420cd6c67
commit
dd8b6094c0
@ -1,5 +1,16 @@
|
|||||||
# HACK: This script is invoked with "cmake -P …" as a workaround to silence uncrustify.
|
# HACK: This script is invoked with "cmake -P …" as a workaround to silence uncrustify.
|
||||||
|
|
||||||
|
# Split space-separated string into a cmake list, so that execute_process()
|
||||||
|
# will pass each file as individual arg to uncrustify.
|
||||||
|
string(REPLACE " " ";" NVIM_SOURCES ${NVIM_SOURCES})
|
||||||
|
string(REPLACE " " ";" NVIM_HEADERS ${NVIM_HEADERS})
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${UNCRUSTIFY_PRG} -c "${PROJECT_SOURCE_DIR}/src/uncrustify.cfg" -q --check ${LINT_NVIM_SOURCES}
|
COMMAND ${UNCRUSTIFY_PRG} -c "${PROJECT_SOURCE_DIR}/src/uncrustify.cfg" -q --check ${NVIM_SOURCES} ${NVIM_HEADERS}
|
||||||
OUTPUT_QUIET)
|
OUTPUT_VARIABLE crusty_out
|
||||||
|
ERROR_VARIABLE crusty_err
|
||||||
|
RESULT_VARIABLE crusty_res)
|
||||||
|
|
||||||
|
if(NOT crusty_res EQUAL 0)
|
||||||
|
message(FATAL_ERROR "crusty: ${crusty_res} ${crusty_err}")
|
||||||
|
endif()
|
||||||
|
@ -808,9 +808,10 @@ def_cmd_target(lintuncrustify ${UNCRUSTIFY_PRG} UNCRUSTIFY_PRG false) # Non-fat
|
|||||||
if(UNCRUSTIFY_PRG)
|
if(UNCRUSTIFY_PRG)
|
||||||
add_custom_command(OUTPUT lintuncrustify-cmd APPEND
|
add_custom_command(OUTPUT lintuncrustify-cmd APPEND
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-DUNCRUSTIFY_PRG=${UNCRUSTIFY_PRG}
|
-D UNCRUSTIFY_PRG=${UNCRUSTIFY_PRG}
|
||||||
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
|
-D PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
|
||||||
-DLINT_NVIM_SOURCES=${LINT_NVIM_SOURCES}
|
-D NVIM_SOURCES="${NVIM_SOURCES}"
|
||||||
|
-D NVIM_HEADERS="${NVIM_HEADERS}"
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunUncrustify.cmake)
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunUncrustify.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user