aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Download.cmake18
-rw-r--r--cmake/FindJeMalloc.cmake5
-rw-r--r--cmake/FindLibIntl.cmake1
-rw-r--r--cmake/FindLibTermkey.cmake2
-rw-r--r--cmake/FindLibUV.cmake4
-rw-r--r--cmake/FindLibVterm.cmake2
-rw-r--r--cmake/FindLua.cmake197
-rw-r--r--cmake/FindLuaJit.cmake2
-rw-r--r--cmake/FindMsgpack.cmake2
-rw-r--r--cmake/FindUnibilium.cmake2
-rw-r--r--cmake/FindWinpty.cmake10
-rw-r--r--cmake/InstallClintErrors.cmake2
-rw-r--r--cmake/InstallHelpers.cmake9
-rw-r--r--cmake/RunLint.cmake32
-rw-r--r--cmake/RunLuacheck.cmake22
-rw-r--r--cmake/RunTests.cmake10
-rw-r--r--cmake/RunTestsLint.cmake13
17 files changed, 280 insertions, 53 deletions
diff --git a/cmake/Download.cmake b/cmake/Download.cmake
new file mode 100644
index 0000000000..50a77816bc
--- /dev/null
+++ b/cmake/Download.cmake
@@ -0,0 +1,18 @@
+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)
+ if(NOT ALLOW_FAILURE)
+ message(FATAL_ERROR "error: downloading '${URL}' failed
+ status_code: ${status_code}
+ status_string: ${status_string}
+ log: ${log}
+ ")
+ endif()
+endif()
diff --git a/cmake/FindJeMalloc.cmake b/cmake/FindJeMalloc.cmake
index f36cbc6f7a..f139196a38 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)
@@ -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)
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\");
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..3a60a831ea 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)
@@ -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()
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/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 <lua/lua.h>
+#
+# 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)
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)
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)
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}")
diff --git a/cmake/InstallHelpers.cmake b/cmake/InstallHelpers.cmake
index ee07ba2c66..bebc0d0d17 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")
+ elseif(CMAKE_INSTALL_PREFIX MATCHES "^/usr/local$")
+ set(CMAKE_INSTALL_MANDIR "man")
+ endif()
+endif()
+
# For $CMAKE_INSTALL_{DATAROOT,MAN, ...}DIR
include(GNUInstallDirs)
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()
diff --git a/cmake/RunLuacheck.cmake b/cmake/RunLuacheck.cmake
new file mode 100644
index 0000000000..5129541cd8
--- /dev/null
+++ b/cmake/RunLuacheck.cmake
@@ -0,0 +1,22 @@
+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}" ${LUACHECK_ARGS}
+ WORKING_DIRECTORY "${LUAFILES_DIR}"
+ ERROR_VARIABLE err
+ RESULT_VARIABLE res
+)
+
+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/RunTests.cmake b/cmake/RunTests.cmake
index 38e0f35213..95c06aeb94 100644
--- a/cmake/RunTests.cmake
+++ b/cmake/RunTests.cmake
@@ -1,8 +1,15 @@
+# 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)
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()
@@ -25,6 +32,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 +46,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}")
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()