cmake: Allow switching from luajit to lua

This commit is contained in:
ZyX 2017-01-21 02:33:09 +03:00
parent 666d85d3ce
commit 1646a28173
2 changed files with 14 additions and 3 deletions

View File

@ -310,8 +310,15 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
find_package(Msgpack 1.0.0 REQUIRED) find_package(Msgpack 1.0.0 REQUIRED)
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS}) include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LuaJit REQUIRED) option(PREFER_LUAJIT "Prefer LuaJIT over Lua." ON)
include_directories(SYSTEM ${LUAJIT_INCLUDE_DIRS})
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) if(UNIX)
option(FEAT_TUI "Enable the Terminal UI" ON) option(FEAT_TUI "Enable the Terminal UI" ON)

View File

@ -291,8 +291,12 @@ list(APPEND NVIM_LINK_LIBRARIES
${LIBTERMKEY_LIBRARIES} ${LIBTERMKEY_LIBRARIES}
${UNIBILIUM_LIBRARIES} ${UNIBILIUM_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${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) if(UNIX)
list(APPEND NVIM_LINK_LIBRARIES list(APPEND NVIM_LINK_LIBRARIES