From b60e5c85adb597f5a1688de47198175b2747fbd4 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 25 Mar 2017 23:02:20 +0100 Subject: cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) --- cmake/FindJeMalloc.cmake | 2 +- cmake/FindLibTermkey.cmake | 2 +- cmake/FindLibUV.cmake | 2 +- cmake/FindLibVterm.cmake | 2 +- cmake/FindLuaJit.cmake | 2 +- cmake/FindMsgpack.cmake | 2 +- cmake/FindUnibilium.cmake | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'cmake') diff --git a/cmake/FindJeMalloc.cmake b/cmake/FindJeMalloc.cmake index f36cbc6f7a..820ceeed4a 100644 --- a/cmake/FindJeMalloc.cmake +++ b/cmake/FindJeMalloc.cmake @@ -4,7 +4,7 @@ # JEMALLOC_INCLUDE_DIRS - The jemalloc include directories # JEMALLOC_LIBRARIES - The libraries needed to use jemalloc -if(NOT JEMALLOC_USE_BUNDLED) +if(NOT USE_BUNDLED_JEMALLOC) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_JEMALLOC QUIET jemalloc) diff --git a/cmake/FindLibTermkey.cmake b/cmake/FindLibTermkey.cmake index 144deceaae..66fd2e6c89 100644 --- a/cmake/FindLibTermkey.cmake +++ b/cmake/FindLibTermkey.cmake @@ -4,7 +4,7 @@ # LIBTERMKEY_INCLUDE_DIRS - The libtermkey include directories # LIBTERMKEY_LIBRARIES - The libraries needed to use libtermkey -if(NOT LIBTERMKEY_USE_BUNDLED) +if(NOT USE_BUNDLED_LIBTERMKEY) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_LIBTERMKEY QUIET termkey) diff --git a/cmake/FindLibUV.cmake b/cmake/FindLibUV.cmake index dcdd5e48b7..3e042e4c50 100644 --- a/cmake/FindLibUV.cmake +++ b/cmake/FindLibUV.cmake @@ -8,7 +8,7 @@ # Set the LIBUV_USE_STATIC variable to specify if static libraries should # be preferred to shared ones. -if(NOT LIBUV_USE_BUNDLED) +if(NOT USE_BUNDLED_LIBUV) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_LIBUV QUIET libuv) diff --git a/cmake/FindLibVterm.cmake b/cmake/FindLibVterm.cmake index 0d773d8896..2cbd3215c5 100644 --- a/cmake/FindLibVterm.cmake +++ b/cmake/FindLibVterm.cmake @@ -4,7 +4,7 @@ # LIBVTERM_INCLUDE_DIRS - The libvterm include directories # LIBVTERM_LIBRARIES - The libraries needed to use libvterm -if(NOT LIBVTERM_USE_BUNDLED) +if(NOT USE_BUNDLED_LIBVTERM) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_LIBVTERM QUIET vterm) diff --git a/cmake/FindLuaJit.cmake b/cmake/FindLuaJit.cmake index e9ff53ab62..b8eda6388b 100644 --- a/cmake/FindLuaJit.cmake +++ b/cmake/FindLuaJit.cmake @@ -4,7 +4,7 @@ # LUAJIT_INCLUDE_DIRS - The luajit include directories # LUAJIT_LIBRARIES - The libraries needed to use luajit -if(NOT LUAJIT_USE_BUNDLED) +if(NOT USE_BUNDLED_LUAJIT) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_LUAJIT QUIET luajit) diff --git a/cmake/FindMsgpack.cmake b/cmake/FindMsgpack.cmake index 8881a34332..6716289a98 100644 --- a/cmake/FindMsgpack.cmake +++ b/cmake/FindMsgpack.cmake @@ -4,7 +4,7 @@ # MSGPACK_INCLUDE_DIRS - The msgpack include directories # MSGPACK_LIBRARIES - The libraries needed to use msgpack -if(NOT MSGPACK_USE_BUNDLED) +if(NOT USE_BUNDLED_MSGPACK) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_search_module(PC_MSGPACK QUIET diff --git a/cmake/FindUnibilium.cmake b/cmake/FindUnibilium.cmake index e1e0de9b7e..cf0ccda877 100644 --- a/cmake/FindUnibilium.cmake +++ b/cmake/FindUnibilium.cmake @@ -4,7 +4,7 @@ # UNIBILIUM_INCLUDE_DIRS - The unibilium include directories # UNIBILIUM_LIBRARIES - The libraries needed to use unibilium -if(NOT UNIBILIUM_USE_BUNDLED) +if(NOT USE_BUNDLED_UNIBILIUM) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_UNIBILIUM QUIET unibilium) -- cgit From 1ea9ebf112d6c9d6355038afb4aaee794187cb23 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 29 Mar 2017 20:07:39 +0200 Subject: test: Use workspace-local temp directory. Closes #6291 --- cmake/RunTests.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmake') diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 38e0f35213..bd7b630708 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -25,6 +25,8 @@ if(DEFINED ENV{TEST_FILTER}) set(TEST_TAG "--filter=$ENV{TEST_FILTER}") endif() +execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${WORKING_DIR}/Xtest-tmpdir) +set(ENV{TMPDIR} ${WORKING_DIR}/Xtest-tmpdir) set(ENV{SYSTEM_NAME} ${SYSTEM_NAME}) execute_process( COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE} @@ -37,6 +39,7 @@ execute_process( file(REMOVE ${WORKING_DIR}/Xtest_rplugin_manifest) file(REMOVE_RECURSE ${WORKING_DIR}/Xtest_xdg) +file(REMOVE_RECURSE ${WORKING_DIR}/Xtest-tmpdir) if(NOT res EQUAL 0) message(STATUS "Output to stderr:\n${err}") -- cgit From 030c0588a04c7b201ed21ab6bcbc38c040e3d5b6 Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 31 Mar 2017 10:51:41 +0300 Subject: cmake: Add `clint` target to build Makefile Allows linting only modified files and linting multiple files in parallel. In the current state is rather slow because errors.json is a 6 MiB file and needs to be reparsed each time. Results on my system (6-core): # In build dir, actually parallel make -j5 clint 241.24s user 8.39s system 334% cpu 1:14.74 total # In root, one process make -j5 clint 60.69s user 0.37s system 93% cpu 1:05.19 total In both cases download time included. That is not well for travis (though I would keep travis as-is because new variant will fail before checking all files), but already good enough for regular development: total times are nearly identical and this is the *full* build, further `make -C build clint` will check only modified files. --- cmake/Download.cmake | 1 + 1 file changed, 1 insertion(+) create mode 100644 cmake/Download.cmake (limited to 'cmake') diff --git a/cmake/Download.cmake b/cmake/Download.cmake new file mode 100644 index 0000000000..07ec174852 --- /dev/null +++ b/cmake/Download.cmake @@ -0,0 +1 @@ +file(DOWNLOAD "${URL}" "${FILE}") -- cgit From 8204eaea7f07c7fd2784bee2c2cfd495d49877df Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 31 Mar 2017 11:39:31 +0300 Subject: cmake: Make Download.cmake check for errors Copying from third-party/cmake/DownloadAndExtractFile.cmake. --- cmake/Download.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/Download.cmake b/cmake/Download.cmake index 07ec174852..470bb19a08 100644 --- a/cmake/Download.cmake +++ b/cmake/Download.cmake @@ -1 +1,16 @@ -file(DOWNLOAD "${URL}" "${FILE}") +file( + DOWNLOAD "${URL}" "${FILE}" + STATUS status + LOG log +) + +list(GET status 0 status_code) +list(GET status 1 status_string) + +if(NOT status_code EQUAL 0) + message(FATAL_ERROR "error: downloading '${URL}' failed + status_code: ${status_code} + status_string: ${status_string} + log: ${log} +") +endif() -- cgit From 24fd125893203c667789cb574b289fc1c9eaf6bc Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 31 Mar 2017 11:49:18 +0300 Subject: cmake: Allow failing to download small suppress files --- cmake/Download.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cmake') diff --git a/cmake/Download.cmake b/cmake/Download.cmake index 470bb19a08..50a77816bc 100644 --- a/cmake/Download.cmake +++ b/cmake/Download.cmake @@ -8,9 +8,11 @@ list(GET status 0 status_code) list(GET status 1 status_string) if(NOT status_code EQUAL 0) - message(FATAL_ERROR "error: downloading '${URL}' failed - status_code: ${status_code} - status_string: ${status_string} - log: ${log} -") + if(NOT ALLOW_FAILURE) + message(FATAL_ERROR "error: downloading '${URL}' failed + status_code: ${status_code} + status_string: ${status_string} + log: ${log} + ") + endif() endif() -- cgit From c61858a9978504c645f09de60daf4f9786c2220e Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 31 Mar 2017 12:02:59 +0300 Subject: cmake: Replace RunLint.cmake with code in src/nvim/CMakeLists.txt This also removes LINT_FILE environment variable, other then that functionality is kept. It is expected that developers needing partial linting will use `make lint`, touching interesting file before (if not done already by writing to them). --- cmake/RunLint.cmake | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 cmake/RunLint.cmake (limited to 'cmake') diff --git a/cmake/RunLint.cmake b/cmake/RunLint.cmake deleted file mode 100644 index 306e938232..0000000000 --- a/cmake/RunLint.cmake +++ /dev/null @@ -1,32 +0,0 @@ -get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE) -get_filename_component(LINT_PREFIX ${LINT_DIR} PATH) -set(LINT_SUPPRESS_FILE "${LINT_PREFIX}/errors.json") - -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) - -if(LINT_SUPPRESS_URL) - file(DOWNLOAD ${LINT_SUPPRESS_URL} ${LINT_SUPPRESS_FILE}) - list(APPEND LINT_ARGS "--suppress-errors=${LINT_SUPPRESS_FILE}") -endif() - -foreach(lint_file ${LINT_FILES}) - file(RELATIVE_PATH lint_file "${LINT_PREFIX}" "${lint_file}") - list(APPEND LINT_ARGS "${lint_file}") -endforeach() - -execute_process( - COMMAND ${LINT_PRG} ${LINT_ARGS} - RESULT_VARIABLE res - WORKING_DIRECTORY "${LINT_PREFIX}") - -file(REMOVE ${LINT_SUPPRESS_FILE}) - -if(NOT res EQUAL 0) - message(FATAL_ERROR "Linting failed: ${res}.") -endif() -- cgit From 3a6b8c28c813f8e65851c8e89c7cf56b4d6cf03f Mon Sep 17 00:00:00 2001 From: Nikolai Aleksandrovich Pavlov Date: Sun, 9 Apr 2017 04:28:48 +0300 Subject: cmake: Use archive instead of downloading *.json files (#6482) --- cmake/InstallClintErrors.cmake | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 cmake/InstallClintErrors.cmake (limited to 'cmake') diff --git a/cmake/InstallClintErrors.cmake b/cmake/InstallClintErrors.cmake new file mode 100644 index 0000000000..bd5ca07828 --- /dev/null +++ b/cmake/InstallClintErrors.cmake @@ -0,0 +1,2 @@ +file(GLOB_RECURSE JSON_FILES *.json) +file(COPY ${JSON_FILES} DESTINATION "${TARGET}") -- cgit From 3ea2063e07c979f29bb447c4cecf1cfffaaca4be Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 10 Apr 2017 23:10:55 +0300 Subject: cmake: Add FindLua.cmake Copied from CMake v3.8.0-707-g0419ecb, modified one include() line. --- cmake/FindLua.cmake | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 cmake/FindLua.cmake (limited to 'cmake') diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake new file mode 100644 index 0000000000..b669a49f29 --- /dev/null +++ b/cmake/FindLua.cmake @@ -0,0 +1,197 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#.rst: +# FindLua +# ------- +# +# +# +# Locate Lua library This module defines +# +# :: +# +# LUA_FOUND - if false, do not try to link to Lua +# LUA_LIBRARIES - both lua and lualib +# LUA_INCLUDE_DIR - where to find lua.h +# LUA_VERSION_STRING - the version of Lua found +# LUA_VERSION_MAJOR - the major version of Lua +# LUA_VERSION_MINOR - the minor version of Lua +# LUA_VERSION_PATCH - the patch version of Lua +# +# +# +# Note that the expected include convention is +# +# :: +# +# #include "lua.h" +# +# and not +# +# :: +# +# #include +# +# This is because, the lua location is not standardized and may exist in +# locations other than lua/ + +unset(_lua_include_subdirs) +unset(_lua_library_names) +unset(_lua_append_versions) + +# this is a function only to have all the variables inside go away automatically +function(_lua_set_version_vars) + set(LUA_VERSIONS5 5.3 5.2 5.1 5.0) + + if (Lua_FIND_VERSION_EXACT) + if (Lua_FIND_VERSION_COUNT GREATER 1) + set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}) + endif () + elseif (Lua_FIND_VERSION) + # once there is a different major version supported this should become a loop + if (NOT Lua_FIND_VERSION_MAJOR GREATER 5) + if (Lua_FIND_VERSION_COUNT EQUAL 1) + set(_lua_append_versions ${LUA_VERSIONS5}) + else () + foreach (subver IN LISTS LUA_VERSIONS5) + if (NOT subver VERSION_LESS ${Lua_FIND_VERSION}) + list(APPEND _lua_append_versions ${subver}) + endif () + endforeach () + endif () + endif () + else () + # once there is a different major version supported this should become a loop + set(_lua_append_versions ${LUA_VERSIONS5}) + endif () + + list(APPEND _lua_include_subdirs "include/lua" "include") + + foreach (ver IN LISTS _lua_append_versions) + string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}") + list(APPEND _lua_include_subdirs + include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2} + include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2} + include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2} + ) + endforeach () + + set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE) + set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE) +endfunction(_lua_set_version_vars) + +function(_lua_check_header_version _hdr_file) + # At least 5.[012] have different ways to express the version + # so all of them need to be tested. Lua 5.2 defines LUA_VERSION + # and LUA_RELEASE as joined by the C preprocessor, so avoid those. + file(STRINGS "${_hdr_file}" lua_version_strings + REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*") + + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};") + if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};") + set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") + else () + string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") + if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") + endif () + string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}") + string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}") + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}") + endif () + foreach (ver IN LISTS _lua_append_versions) + if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") + set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE) + set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE) + set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE) + set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE) + return() + endif () + endforeach () +endfunction(_lua_check_header_version) + +_lua_set_version_vars() + +if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h") + _lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h") +endif () + +if (NOT LUA_VERSION_STRING) + foreach (subdir IN LISTS _lua_include_subdirs) + unset(LUA_INCLUDE_PREFIX CACHE) + find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h + HINTS + ENV LUA_DIR + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt + ) + if (LUA_INCLUDE_PREFIX) + _lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h") + if (LUA_VERSION_STRING) + set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}") + break() + endif () + endif () + endforeach () +endif () +unset(_lua_include_subdirs) +unset(_lua_append_versions) + +if (LUA_VERSION_STRING) + set(_lua_library_names + lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR} + lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} + lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} + lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} + ) +endif () + +find_library(LUA_LIBRARY + NAMES ${_lua_library_names} lua + HINTS + ENV LUA_DIR + PATH_SUFFIXES lib + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw + /opt/local + /opt/csw + /opt +) +unset(_lua_library_names) + +if (LUA_LIBRARY) + # include the math library for Unix + if (UNIX AND NOT APPLE AND NOT BEOS) + find_library(LUA_MATH_LIBRARY m) + set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}") + + # include dl library for statically-linked Lua library + get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT) + if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX) + list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS}) + endif() + + # For Windows and Mac, don't need to explicitly include the math library + else () + set(LUA_LIBRARIES "${LUA_LIBRARY}") + endif () +endif () + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if +# all listed variables are TRUE +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua + REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR + VERSION_VAR LUA_VERSION_STRING) + +mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY) -- cgit From 53b38251bb0bfdb1d002b09001417e708d85e422 Mon Sep 17 00:00:00 2001 From: Edd Barrett Date: Wed, 3 May 2017 19:16:06 +0100 Subject: build: OpenBSD: libuv does not use KVM, do not link to it. (#6663) --- cmake/FindLibUV.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/FindLibUV.cmake b/cmake/FindLibUV.cmake index 3e042e4c50..3a60a831ea 100644 --- a/cmake/FindLibUV.cmake +++ b/cmake/FindLibUV.cmake @@ -65,7 +65,7 @@ if(HAVE_LIBKSTAT) endif() check_library_exists(kvm kvm_open "kvm.h" HAVE_LIBKVM) -if(HAVE_LIBKVM) +if(HAVE_LIBKVM AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") list(APPEND LIBUV_LIBRARIES kvm) endif() -- cgit From 5b84c211824e0a7306bc975c88d4cd6138fe5b98 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 25 May 2017 16:34:04 +0300 Subject: cmake: Rename RunTestsLint to RunLuacheck --- cmake/RunLuacheck.cmake | 13 +++++++++++++ cmake/RunTestsLint.cmake | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 cmake/RunLuacheck.cmake delete mode 100644 cmake/RunTestsLint.cmake (limited to 'cmake') diff --git a/cmake/RunLuacheck.cmake b/cmake/RunLuacheck.cmake new file mode 100644 index 0000000000..addc9ab35e --- /dev/null +++ b/cmake/RunLuacheck.cmake @@ -0,0 +1,13 @@ +set(IGNORE_FILES "${TEST_DIR}/*/preload.lua") + +execute_process( + COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES} + WORKING_DIRECTORY ${TEST_DIR} + ERROR_VARIABLE err + RESULT_VARIABLE res + ${EXTRA_ARGS}) + +if(NOT res EQUAL 0) + message(STATUS "Output to stderr:\n${err}") + message(FATAL_ERROR "Linting tests failed with error: ${res}.") +endif() diff --git a/cmake/RunTestsLint.cmake b/cmake/RunTestsLint.cmake deleted file mode 100644 index addc9ab35e..0000000000 --- a/cmake/RunTestsLint.cmake +++ /dev/null @@ -1,13 +0,0 @@ -set(IGNORE_FILES "${TEST_DIR}/*/preload.lua") - -execute_process( - COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES} - WORKING_DIRECTORY ${TEST_DIR} - ERROR_VARIABLE err - RESULT_VARIABLE res - ${EXTRA_ARGS}) - -if(NOT res EQUAL 0) - message(STATUS "Output to stderr:\n${err}") - message(FATAL_ERROR "Linting tests failed with error: ${res}.") -endif() -- cgit From 58f6ef50a86b968b923dfcf5efffacb665fdfa44 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 25 May 2017 16:50:06 +0300 Subject: ci: Also lint lua code in src/nvim/lua --- cmake/RunLuacheck.cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'cmake') diff --git a/cmake/RunLuacheck.cmake b/cmake/RunLuacheck.cmake index addc9ab35e..5129541cd8 100644 --- a/cmake/RunLuacheck.cmake +++ b/cmake/RunLuacheck.cmake @@ -1,11 +1,20 @@ -set(IGNORE_FILES "${TEST_DIR}/*/preload.lua") +set(LUACHECK_ARGS -q "${LUAFILES_DIR}") +if(DEFINED IGNORE_PATTERN) + list(APPEND LUACHECK_ARGS --exclude-files "${LUAFILES_DIR}/${IGNORE_PATTERN}") +endif() +if(DEFINED CHECK_PATTERN) + list(APPEND LUACHECK_ARGS --include-files "${LUAFILES_DIR}/${CHECK_PATTERN}") +endif() +if(DEFINED READ_GLOBALS) + list(APPEND LUACHECK_ARGS --read-globals "${READ_GLOBALS}") +endif() execute_process( - COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES} - WORKING_DIRECTORY ${TEST_DIR} + COMMAND "${LUACHECK_PRG}" ${LUACHECK_ARGS} + WORKING_DIRECTORY "${LUAFILES_DIR}" ERROR_VARIABLE err RESULT_VARIABLE res - ${EXTRA_ARGS}) +) if(NOT res EQUAL 0) message(STATUS "Output to stderr:\n${err}") -- cgit From a84926763f153ee2a97c1882223ecf925c05ba78 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 21 May 2017 14:05:38 +0200 Subject: install: bsd: install manpages to /usr/local/man https://svnweb.freebsd.org/ports/head/editors/neovim/Makefile?revision=428479&view=markup#l28 Closes #6771 --- cmake/InstallHelpers.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmake') diff --git a/cmake/InstallHelpers.cmake b/cmake/InstallHelpers.cmake index ee07ba2c66..ca20ddf354 100644 --- a/cmake/InstallHelpers.cmake +++ b/cmake/InstallHelpers.cmake @@ -1,3 +1,12 @@ +# Fix CMAKE_INSTALL_MANDIR on BSD before including GNUInstallDirs. #6771 +if(CMAKE_SYSTEM_NAME MATCHES "BSD" AND NOT DEFINED CMAKE_INSTALL_MANDIR) + if(DEFINED ENV{MANPREFIX}) + set(CMAKE_INSTALL_MANDIR "$ENV{MANPREFIX}/man") + else() + set(CMAKE_INSTALL_MANDIR "/usr/local/man") + endif() +endif() + # For $CMAKE_INSTALL_{DATAROOT,MAN, ...}DIR include(GNUInstallDirs) -- cgit From a49c92fc5b12cd9645b8638b409442ad3ca652bc Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 31 May 2017 10:45:20 +0200 Subject: test: Set $NVIM_LOG_FILE to test-local path - Do not delete it: may need to inspect it after tests finished. - Avoids writing to stderr in cases where the test-local $XDG_DATA_HOME was not created yet. --- cmake/RunTests.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmake') diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index bd7b630708..5f818cc9ad 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -3,6 +3,10 @@ set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest) set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config) set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share) +if(NOT DEFINED ENV{NVIM_LOG_FILE}) + set(ENV{NVIM_LOG_FILE} ${WORKING_DIR}/.nvimlog) +endif() + if(NVIM_PRG) set(ENV{NVIM_PRG} "${NVIM_PRG}") endif() -- cgit From 35fad15c8907f741ce21779393e4377de753e4f9 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 7 Jul 2017 11:26:20 -0400 Subject: Prefer the static jemalloc library by default on OSX When neovim is dynamically linked against jemalloc on OSX, users are hitting the deadlock described in jemalloc/jemalloc#895. --- cmake/FindJeMalloc.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmake') diff --git a/cmake/FindJeMalloc.cmake b/cmake/FindJeMalloc.cmake index 820ceeed4a..f139196a38 100644 --- a/cmake/FindJeMalloc.cmake +++ b/cmake/FindJeMalloc.cmake @@ -27,6 +27,9 @@ find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h if(JEMALLOC_USE_STATIC) list(APPEND JEMALLOC_NAMES "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + list(INSERT JEMALLOC_NAMES 0 + "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() list(APPEND JEMALLOC_NAMES jemalloc) -- cgit From 5c08c8c00969b8945f1351f49b0afb7e3e8842fe Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 29 Jul 2017 00:34:14 +0200 Subject: test: force LC_ALL=en_US.UTF-8 Tests that check localized error messages need a stable locale, else errors like this occur: [ FAILED ] 2 tests, listed below: [ FAILED ] ...npack/file/vim/neovim/test/functional/eval/null_spec.lua @ 29: NULL list is accepted as an empty list by writefile() ...npack/file/vim/neovim/test/functional/eval/null_spec.lua:30: Expected objects to be the same. Passed in: (string) ' E484: Cannot open file Xtest-functional-viml-null' Expected: (string) ' E484: Can't open file Xtest-functional-viml-null' stack traceback: ...npack/file/vim/neovim/test/functional/eval/null_spec.lua:30: in function <...npack/file/vim/neovim/test/functional/eval/null_spec.lua:29> [ FAILED ] ...k/file/vim/neovim/test/functional/ex_cmds/write_spec.lua @ 81: :write errors out correctly ...k/file/vim/neovim/test/functional/ex_cmds/write_spec.lua:97: Expected objects to be the same. Passed in: (string) 'Vim(write):E510: Cannot make backup file (add ! to override)' Expected: (string) 'Vim(write):E510: Can't make backup file (add ! to override)' stack traceback: ...k/file/vim/neovim/test/functional/ex_cmds/write_spec.lua:97: in function <...k/file/vim/neovim/test/functional/ex_cmds/write_spec.lua:81> 10 SKIPPED TESTS 2 FAILED TESTS -- Output to stderr: 2017/07/29 00:41:32 ERROR 31133/open_log_file:170: Logging to stderr, failed to open $NVIM_LOG_FILE: Xtest-startup-xdg-logpath/nvim/log 2017/07/29 00:41:32 WARN 31133/call_set_error:815: RPC: ch 1 was closed by the client CMake Error at /home/shlomif/Download/unpack/file/vim/neovim/cmake/RunTests.cmake:50 (message): Running functional tests failed with error: 1. FAILED: CMakeFiles/functionaltest cd /home/shlomif/Download/unpack/file/vim/neovim/build && /usr/bin/cmake -DBUSTED_PRG=/home/shlomif/Download/unpack/file/vim/neovim/.deps/usr/bin/busted -DLUA_PRG=/home/shlomif/Download/unpack/file/vim/neovim/.deps/usr/bin/luajit -DNVIM_PRG=/home/shlomif/Download/unpack/file/vim/neovim/build/bin/nvim -DWORKING_DIR=/home/shlomif/Download/unpack/file/vim/neovim -DBUSTED_OUTPUT_TYPE=nvim -DTEST_DIR=/home/shlomif/Download/unpack/file/vim/neovim/test -DBUILD_DIR=/home/shlomif/Download/unpack/file/vim/neovim/build -DTEST_TYPE=functional -DSYSTEM_NAME=Linux -P /home/shlomif/Download/unpack/file/vim/neovim/cmake/RunTests.cmake ninja: build stopped: subcommand failed. Makefile:102: recipe for target 'functionaltest' failed make: *** [functionaltest] Error 1 --- cmake/RunTests.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmake') diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 5f818cc9ad..95c06aeb94 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -1,3 +1,6 @@ +# Set LC_ALL to meet expectations of some locale-sensitive tests. +set(ENV{LC_ALL} "en_US.UTF-8") + set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime) set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest) set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config) -- cgit From 7f22a27a10655dc40528f35034cbdf8c9543241c Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Wed, 24 Feb 2016 02:14:19 -0600 Subject: win: integrate winpty (WIP) Handling of process exit is still broken. It detects the moment when the child process exits, then quickly stops polling for process output. It should continue polling for output until the agent has scraped all of the process' output. This problem is easy to notice by running a command like "dir && exit", but even typing "exit" can manifest the problem -- the "t" might not appear. winpty's Cygwin adapter handles shutdown by waiting for the agent to close the CONOUT pipe, which it does after it has scraped the child's last output. AFAIK, neovim doesn't do anything interesting when winpty closes the CONOUT pipe. --- cmake/FindWinpty.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 cmake/FindWinpty.cmake (limited to 'cmake') diff --git a/cmake/FindWinpty.cmake b/cmake/FindWinpty.cmake new file mode 100644 index 0000000000..8feafc58a8 --- /dev/null +++ b/cmake/FindWinpty.cmake @@ -0,0 +1,10 @@ +include(LibFindMacros) + +find_path(WINPTY_INCLUDE_DIR winpty.h) +set(WINPTY_INCLUDE_DIRS ${WINPTY_INCLUDE_DIR}) + +find_library(WINPTY_LIBRARY winpty) +find_program(WINPTY_AGENT_EXE winpty-agent.exe) +set(WINPTY_LIBRARIES ${WINPTY_LIBRARY}) + +find_package_handle_standard_args(Winpty DEFAULT_MSG WINPTY_LIBRARY WINPTY_INCLUDE_DIR) -- cgit From 235fda5f86d80b1aa7d7cbcb41e3399c556b7455 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 3 Oct 2017 14:53:11 -0400 Subject: Stub ngettext when libintl isn't available This should have been included in #6547 as part of vim-patch:7.4.2152. Closes #7352 --- cmake/FindLibIntl.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'cmake') diff --git a/cmake/FindLibIntl.cmake b/cmake/FindLibIntl.cmake index 75926200c1..ab4632cf45 100644 --- a/cmake/FindLibIntl.cmake +++ b/cmake/FindLibIntl.cmake @@ -46,6 +46,7 @@ check_c_source_compiles(" int main(int argc, char** argv) { gettext(\"foo\"); + ngettext(\"foo\", \"bar\", 1); bindtextdomain(\"foo\", \"bar\"); bind_textdomain_codeset(\"foo\", \"bar\"); textdomain(\"foo\"); -- cgit From 3ce97879d09c5cbeba6fdc5ebd7525b127df18e0 Mon Sep 17 00:00:00 2001 From: Franklin Mathieu Date: Sat, 21 Oct 2017 01:36:26 +0100 Subject: cmake,bsd: Fix mandir to saner defaults. (#7417) closes #7239 The old behaviour was to set CMAKE_INSTALL_MANDIR to /usr/local/man when MANPREFIX wasn't defined. This caused mismatching installation paths when the installation prefix wasn't /usr/local. This fix explicitely checks that the prefix is /usr/local to change the value of CMAKE_INSTALL_MANDIR, and uses the default behaviour otherwise, as /usr/local is the exception rather than the norm (as per man hier(7)). --- cmake/InstallHelpers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmake') diff --git a/cmake/InstallHelpers.cmake b/cmake/InstallHelpers.cmake index ca20ddf354..bebc0d0d17 100644 --- a/cmake/InstallHelpers.cmake +++ b/cmake/InstallHelpers.cmake @@ -2,8 +2,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "BSD" AND NOT DEFINED CMAKE_INSTALL_MANDIR) if(DEFINED ENV{MANPREFIX}) set(CMAKE_INSTALL_MANDIR "$ENV{MANPREFIX}/man") - else() - set(CMAKE_INSTALL_MANDIR "/usr/local/man") + elseif(CMAKE_INSTALL_PREFIX MATCHES "^/usr/local$") + set(CMAKE_INSTALL_MANDIR "man") endif() endif() -- cgit