mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
Use cmake to find a lua executable
A lua executable is now required for the build process since a lpeg-based script is used for generating a dispatch function and metadata for the msgpack API frontend. This removes the need for setting the LUA_BINARY environment variable. Fixes #518.
This commit is contained in:
parent
a1dd6a6dd8
commit
3ee5683a78
@ -68,12 +68,24 @@ endif(NOT CMAKE_USE_PTHREADS_INIT)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
find_program(LUA_PRG luajit)
|
||||
|
||||
# Need a lua interpreter for running the msgapck metadata/dispatch generator
|
||||
if(NOT EXISTS ${LUA_PRG})
|
||||
find_program(LUA_PRG lua)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${LUA_PRG})
|
||||
message(STATUS "Using the lua interpreter ${LUA_PRG}")
|
||||
else()
|
||||
message(FATAL_ERROR "A lua interpreter is required for building the Neovim")
|
||||
endif()
|
||||
|
||||
add_subdirectory(config)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(test/includes)
|
||||
|
||||
find_program(BUSTED_PRG busted)
|
||||
find_program(LUAJIT_PRG luajit)
|
||||
|
||||
find_program(MAKE_PRG NAMES gmake make)
|
||||
if(MAKE_PRG)
|
||||
|
@ -1,11 +1,5 @@
|
||||
include(CheckLibraryExists)
|
||||
|
||||
if(DEFINED ENV{LUA_BINARY})
|
||||
set(LUA_BIN $ENV{LUA_BINARY})
|
||||
else()
|
||||
set(LUA_BIN ${DEPS_BIN_DIR}/luajit)
|
||||
endif()
|
||||
|
||||
set(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/auto)
|
||||
set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/msgpack-gen.lua)
|
||||
set(API_HEADER ${PROJECT_SOURCE_DIR}/src/api.h)
|
||||
@ -15,7 +9,7 @@ set(MSGPACK_DISPATCH ${GENERATED_DIR}/msgpack_dispatch.c)
|
||||
file(MAKE_DIRECTORY ${GENERATED_DIR})
|
||||
|
||||
add_custom_command(OUTPUT ${MSGPACK_DISPATCH}
|
||||
COMMAND ${LUA_BIN} ${DISPATCH_GENERATOR} ${API_HEADER} ${MSGPACK_DISPATCH}
|
||||
COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${API_HEADER} ${MSGPACK_DISPATCH}
|
||||
DEPENDS
|
||||
${API_HEADER}
|
||||
${MSGPACK_RPC_HEADER}
|
||||
|
Loading…
Reference in New Issue
Block a user