diff options
author | ZyX <kp-pav@yandex.ru> | 2017-01-21 02:33:09 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-27 00:12:23 +0300 |
commit | 1646a28173d1b7c8309188ebe7b6fb38a6ca8315 (patch) | |
tree | e2057ccdf497c7d5eda84c8826a19fbe10ff426c | |
parent | 666d85d3ce80c19c9cd2acd156edbf50fd7e8741 (diff) | |
download | rneovim-1646a28173d1b7c8309188ebe7b6fb38a6ca8315.tar.gz rneovim-1646a28173d1b7c8309188ebe7b6fb38a6ca8315.tar.bz2 rneovim-1646a28173d1b7c8309188ebe7b6fb38a6ca8315.zip |
cmake: Allow switching from luajit to lua
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/nvim/CMakeLists.txt | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b746dd460e..782dc8c87a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,8 +310,15 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS}) find_package(Msgpack 1.0.0 REQUIRED) include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS}) -find_package(LuaJit REQUIRED) -include_directories(SYSTEM ${LUAJIT_INCLUDE_DIRS}) +option(PREFER_LUAJIT "Prefer LuaJIT over Lua." ON) + +if(PREFER_LUAJIT) + find_package(LuaJit REQUIRED) + include_directories(SYSTEM ${LUAJIT_INCLUDE_DIRS}) +else() + find_package(Lua REQUIRED) + include_directories(SYSTEM ${LUA_INCLUDE_DIR}) +endif() if(UNIX) option(FEAT_TUI "Enable the Terminal UI" ON) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index a47a8e49c7..7a7dbbcce6 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -291,8 +291,12 @@ list(APPEND NVIM_LINK_LIBRARIES ${LIBTERMKEY_LIBRARIES} ${UNIBILIUM_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - ${LUAJIT_LIBRARIES} ) +if(PREFER_LUAJIT) + list(APPEND NVIM_LINK_LIBRARIES ${LUAJIT_LIBRARIES}) +else() + list(APPEND NVIM_LINK_LIBRARIES ${LUA_LIBRARIES}) +endif() if(UNIX) list(APPEND NVIM_LINK_LIBRARIES |