aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindJeMalloc.cmake3
-rw-r--r--cmake/FindLibIntl.cmake3
-rw-r--r--cmake/FindMsgpack.cmake2
-rw-r--r--cmake/FindWinpty.cmake10
-rw-r--r--cmake/GetCompileFlags.cmake1
-rw-r--r--cmake/InstallHelpers.cmake4
-rw-r--r--cmake/LuaHelpers.cmake5
-rw-r--r--cmake/RunTests.cmake5
8 files changed, 25 insertions, 8 deletions
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)
diff --git a/cmake/FindLibIntl.cmake b/cmake/FindLibIntl.cmake
index 75926200c1..f8442566a9 100644
--- a/cmake/FindLibIntl.cmake
+++ b/cmake/FindLibIntl.cmake
@@ -27,7 +27,7 @@ find_path(LibIntl_INCLUDE_DIR
)
find_library(LibIntl_LIBRARY
- NAMES intl libintl.a
+ NAMES intl libintl
)
if (LibIntl_INCLUDE_DIR)
@@ -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/FindMsgpack.cmake b/cmake/FindMsgpack.cmake
index 6716289a98..cca0a00c20 100644
--- a/cmake/FindMsgpack.cmake
+++ b/cmake/FindMsgpack.cmake
@@ -44,7 +44,7 @@ endif()
if(MSVC)
# The import library for the msgpack DLL has a different name
- list(APPEND MSGPACK_NAMES msgpack_import)
+ list(APPEND MSGPACK_NAMES msgpackc_import)
else()
list(APPEND MSGPACK_NAMES msgpackc msgpack)
endif()
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/GetCompileFlags.cmake b/cmake/GetCompileFlags.cmake
index e0994b67bc..527bc88cdd 100644
--- a/cmake/GetCompileFlags.cmake
+++ b/cmake/GetCompileFlags.cmake
@@ -38,6 +38,7 @@ function(get_compile_flags _compile_flags)
get_directory_property(include_directories_list
DIRECTORY "src/nvim"
INCLUDE_DIRECTORIES)
+ list(REMOVE_DUPLICATES include_directories_list)
foreach(include_directory ${include_directories_list})
set(include_directories "${include_directories} -I${include_directory}")
endforeach()
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()
diff --git a/cmake/LuaHelpers.cmake b/cmake/LuaHelpers.cmake
index 32f7e46a57..3cba47412b 100644
--- a/cmake/LuaHelpers.cmake
+++ b/cmake/LuaHelpers.cmake
@@ -4,9 +4,8 @@
# Check if a module is available in Lua
function(check_lua_module LUA_PRG_PATH MODULE RESULT_VAR)
- execute_process(COMMAND ${LUA_PRG_PATH} -e "require('${MODULE}')"
- RESULT_VARIABLE module_missing
- ERROR_QUIET)
+ execute_process(COMMAND ${LUA_PRG_PATH} -l "${MODULE}" -e ""
+ RESULT_VARIABLE module_missing)
if(module_missing)
set(${RESULT_VAR} False PARENT_SCOPE)
else()
diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake
index 5f818cc9ad..5b62fd72c9 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)
@@ -35,7 +38,7 @@ set(ENV{SYSTEM_NAME} ${SYSTEM_NAME})
execute_process(
COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE}
--lua=${LUA_PRG} --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
- --lpath=${BUILD_DIR}/?.lua ${TEST_PATH}
+ --lpath=${BUILD_DIR}/?.lua --lpath=?.lua ${TEST_PATH}
WORKING_DIRECTORY ${WORKING_DIR}
ERROR_VARIABLE err
RESULT_VARIABLE res