aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-03-31 11:38:08 +0300
committerZyX <kp-pav@yandex.ru>2017-03-31 16:04:17 +0300
commit0b528fc4b55a8875579d0a1a5dde852b6c3f55dc (patch)
tree5009d7e3b059ccee6e14bf12a3b284c42c491f4f
parent030c0588a04c7b201ed21ab6bcbc38c040e3d5b6 (diff)
downloadrneovim-0b528fc4b55a8875579d0a1a5dde852b6c3f55dc.tar.gz
rneovim-0b528fc4b55a8875579d0a1a5dde852b6c3f55dc.tar.bz2
rneovim-0b528fc4b55a8875579d0a1a5dde852b6c3f55dc.zip
cmake: Use file-specific supprresses
`make -C build clint` time is now make -j5 clint 95.29s user 1.86s system 409% cpu 23.751 total *without* downloading anything (much worse if something was not cached, still a bit better then top-level `make clint`). But since without neovim/bot-ci#95 it is downloading each file one-by-one total time with download (download also parallel!) is make -j5 -B clint 99.29s user 2.98s system 258% cpu 39.634 total Top-level makefile still gives make -j5 clint 59.33s user 0.28s system 95% cpu 1:02.41 total
-rw-r--r--src/nvim/CMakeLists.txt25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 68c0339dc5..b4bc3afc05 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -36,9 +36,12 @@ set(UNICODE_DIR ${PROJECT_SOURCE_DIR}/unicode)
file(GLOB UNICODE_FILES ${UNICODE_DIR}/*.txt)
set(GENERATED_UNICODE_TABLES ${GENERATED_DIR}/unicode_tables.generated.h)
set(LINT_SUPPRESS_FILE ${PROJECT_BINARY_DIR}/errors.json)
-set(LINT_SUPPRESS_URL "https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json")
+set(LINT_SUPPRESS_URL_BASE "https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint")
+set(LINT_SUPPRESS_URL "${LINT_SUPPRESS_URL_BASE}/errors.json")
set(LINT_PRG ${PROJECT_SOURCE_DIR}/src/clint.py)
set(DOWNLOAD_SCRIPT ${PROJECT_SOURCE_DIR}/cmake/Download.cmake)
+set(LINT_SUPPRESSES_ROOT ${PROJECT_BINARY_DIR}/errors)
+set(LINT_SUPPRESSES_URL "https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.tar.gz")
include_directories(${GENERATED_DIR})
include_directories(${CACHED_GENERATED_DIR})
@@ -404,16 +407,20 @@ set_property(TARGET nvim-test APPEND_STRING PROPERTY COMPILE_FLAGS -DUNIT_TESTIN
function(get_test_target prefix sfile relative_path_var target_var)
get_filename_component(full_d "${sfile}" PATH)
file(RELATIVE_PATH d "${PROJECT_SOURCE_DIR}/src/nvim" "${full_d}")
- if(${d} MATCHES "^[.][.]")
+ if(d MATCHES "^[.][.]")
file(RELATIVE_PATH d "${GENERATED_DIR}" "${full_d}")
endif()
get_filename_component(r "${sfile}" NAME)
- if(NOT ${d} EQUAL ".")
+ if(NOT d MATCHES "^[.]?$")
set(r "${d}/${r}")
endif()
string(REGEX REPLACE "[/.]" "-" suffix "${r}")
set(${relative_path_var} ${r} PARENT_SCOPE)
- set(${target_var} "${prefix}-${suffix}" PARENT_SCOPE)
+ if(prefix STREQUAL "")
+ set(${target_var} "${suffix}" PARENT_SCOPE)
+ else()
+ set(${target_var} "${prefix}-${suffix}" PARENT_SCOPE)
+ endif()
endfunction()
set(NO_SINGLE_CHECK_HEADERS
@@ -495,13 +502,17 @@ endfunction()
add_download(${LINT_SUPPRESS_FILE} ${LINT_SUPPRESS_URL})
foreach(sfile ${LINT_NVIM_SOURCES})
- get_test_target("${TOUCHES_DIR}/ran-clint" "${sfile}" r touch_file)
+ get_test_target("" "${sfile}" r suffix)
+ set(suppress_file ${LINT_SUPPRESSES_ROOT}/${suffix}.json)
+ set(suppress_url "${LINT_SUPPRESS_URL_BASE}/${suffix}.json")
+ add_download(${suppress_file} ${suppress_url})
+ set(touch_file "${TOUCHES_DIR}/ran-clint-${suffix}")
add_custom_command(
OUTPUT ${touch_file}
- COMMAND ${LINT_PRG} --suppress-errors=${LINT_SUPPRESS_FILE} src/nvim/${r}
+ COMMAND ${LINT_PRG} --suppress-errors=${suppress_file} src/nvim/${r}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E touch ${touch_file}
- DEPENDS ${sfile} ${LINT_SUPPRESS_FILE}
+ DEPENDS ${sfile} ${suppress_file}
)
list(APPEND LINT_TARGETS ${touch_file})
endforeach()