aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRui Abreu Ferreira <raf-ep@gmx.com>2015-12-20 04:50:20 +0000
committerRui Abreu Ferreira <raf-ep@gmx.com>2016-08-07 21:57:28 +0100
commitdb7fdcd0bab8d5333bc89ab90ff256fcbdccde96 (patch)
tree341c6a8ca774164bc65dbbea720d293378d09f03 /src
parentf53c8258bed7354678e5e355efa2acc471deb11a (diff)
downloadrneovim-db7fdcd0bab8d5333bc89ab90ff256fcbdccde96.tar.gz
rneovim-db7fdcd0bab8d5333bc89ab90ff256fcbdccde96.tar.bz2
rneovim-db7fdcd0bab8d5333bc89ab90ff256fcbdccde96.zip
MSVC: Build third-party dependencies as release DLLs
Using /MT was causing issues when building luarocks, revert it, use the dynammic runtime and generate release DLLs for the dependencies. Some refactoring was required because for linking cmake looks for the import libraries (.lib) but on runtime executables we need the .dll files to be in the same folder. The DLLs are placed in the bin/ folder in order for nvim.exe to run during the build and tests. The install target installs the DLLs with the nvim binary - uses GetPrerequisites to find runtime DLLs. Some minor issues that required adjustments: - [MSVC] FindMsgpack.cmake now looks for msgpack_import.lib instead of msgpack.lib - The lua-client fails to find libuv.lib, instead it looks for uv.lib, added second copy of the file to the install command. - [MSVC] CMAKE_BUILD_TYPE affects the output paths, default to Release. Part of these changes are credited to @jasonwilliams200OK who fixed the third-party recipes to consistently use the same build type.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index d80add2835..5c4df1be0b 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -259,6 +259,21 @@ add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES}
target_link_libraries(nvim ${NVIM_EXEC_LINK_LIBRARIES})
install_helper(TARGETS nvim)
+if(WIN32)
+ # Copy DLLs to bin/ and install them along with nvim
+ add_custom_target(nvim_dll_deps ALL DEPENDS nvim
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/windows_runtime_deps
+ COMMAND ${CMAKE_COMMAND}
+ "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
+ -DBINARY="${PROJECT_BINARY_DIR}/bin/nvim${CMAKE_EXECUTABLE_SUFFIX}"
+ -DDST=${PROJECT_BINARY_DIR}/windows_runtime_deps
+ -P ${PROJECT_SOURCE_DIR}/cmake/WindowsDllCopy.cmake
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_BINARY_DIR}/windows_runtime_deps/
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+ install(DIRECTORY ${PROJECT_BINARY_DIR}/windows_runtime_deps/
+ DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif()
+
if(CLANG_ASAN_UBSAN)
message(STATUS "Enabling Clang address sanitizer and undefined behavior sanitizer for nvim.")
check_c_compiler_flag(-fno-sanitize-recover=all SANITIZE_RECOVER_ALL)