aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2014-03-03 10:09:06 -0500
committerJohn Szakmeister <john@szakmeister.net>2014-03-21 15:22:00 -0400
commit0b2f6a0cf4c50d86744b1d3d774103db39773b4c (patch)
tree7bbc6275200f2c42ba20bf0a910c2b92fbdc4a50 /src
parent5dd0ce4263721b636f5b006a47ceb7e769e10dca (diff)
downloadrneovim-0b2f6a0cf4c50d86744b1d3d774103db39773b4c.tar.gz
rneovim-0b2f6a0cf4c50d86744b1d3d774103db39773b4c.tar.bz2
rneovim-0b2f6a0cf4c50d86744b1d3d774103db39773b4c.zip
Revamp the build system.
This achieves several goals: * Less reliance on scripts so we have better portability to Windows (though we still have a ways to go for proper Windows support). Luajit, luarocks, moonscript, and busted are all installed via CMake now. * Trying to make use of pkg-config to get the correct libraries. The latest libuv is still broken in this regard, but we'll at least be in a position to use it. * Allow the use of Ninja or make. The former runs faster in many environments, and automatically makes use of parallel builds. This also allows for system installed dependencies--though not through the Makefile just yet--and adds support for FreeBSD. This also make us build libuv and luajit as static libraries only, since we're only concerned about having static libraries for our bundled dependencies.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt46
1 files changed, 17 insertions, 29 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4cb988d14c..86be94238a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -25,15 +25,12 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
endif()
-if(NOT DEFINED ENV{SKIP_EXEC})
- add_executable (nvim ${NEOVIM_SOURCES} ${OS_SOURCES})
-endif()
-if(NOT DEFINED ENV{SKIP_UNITTEST})
- add_library (nvim-test MODULE ${NEOVIM_SOURCES} ${OS_SOURCES})
-endif()
-
# The libraries we link against for nvim
-set(NVIM_LINK_LIBRARIES m ${LibUV_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+set(NVIM_LINK_LIBRARIES
+ m
+ ${LIBUV_LIBRARIES}
+ ${LUAJIT_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT})
# Add any libraries needed for a specific platform
if(HAVE_CLOCK_GETTIME)
@@ -45,34 +42,25 @@ if (LibIntl_FOUND)
list(APPEND NVIM_LINK_LIBRARIES ${LibIntl_LIBRARY})
endif()
-if(NOT DEFINED ENV{SKIP_EXEC})
- target_link_libraries (nvim ${NVIM_LINK_LIBRARIES})
-endif()
-if(NOT DEFINED ENV{SKIP_UNITTEST})
- target_link_libraries (nvim-test ${NVIM_LINK_LIBRARIES})
-endif()
-
include(CheckLibraryExists)
+
check_library_exists(curses tgetent "" HAVE_LIBCURSES)
if (HAVE_LIBCURSES)
- if(NOT DEFINED ENV{SKIP_EXEC})
- target_link_libraries(nvim curses)
- endif()
- if(NOT DEFINED ENV{SKIP_UNITTEST})
- target_link_libraries(nvim-test curses)
- endif()
+ list(APPEND NVIM_LINK_LIBRARIES curses)
else()
find_package(Curses REQUIRED)
- if(NOT DEFINED ENV{SKIP_EXEC})
- target_link_libraries(nvim ${CURSES_LIBRARIES})
- endif()
- if(DEFINED ENV{SKIP_UNITTEST})
- target_link_libraries(nvim-test ${CURSES_LIBRARIES})
- endif()
+ list(APPEND NVIM_LINK_LIBRARIES ${CURSES_LIBRARIES})
endif()
-include_directories ("${PROJECT_SOURCE_DIR}/src/proto")
-
if(NOT DEFINED ENV{SKIP_EXEC})
+ add_executable(nvim ${NEOVIM_SOURCES} ${OS_SOURCES})
+ target_link_libraries(nvim ${NVIM_LINK_LIBRARIES})
install(TARGETS nvim RUNTIME DESTINATION bin)
endif()
+
+if(NOT DEFINED ENV{SKIP_UNITTEST})
+ add_library(nvim-test MODULE ${NEOVIM_SOURCES} ${OS_SOURCES})
+ target_link_libraries (nvim-test ${NVIM_LINK_LIBRARIES})
+endif()
+
+include_directories ("${PROJECT_SOURCE_DIR}/src/proto")