cmake: optionally require Lua 5.1 or newer

doc/README.wslua reports support for 5.1 and 5.2 only. Even RHEL6 ships
with Lua 5.1, so it makes not sense to maintain support for Lua 5.0.

Change-Id: I34a8084c7fba19d631b90ce5d5a28198be6a7850
Reviewed-on: https://code.wireshark.org/review/29448
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Peter Wu 2018-09-06 16:18:09 +02:00 committed by Anders Broman
parent 46e71f9a7c
commit d703310749
2 changed files with 3 additions and 4 deletions

View File

@ -1005,6 +1005,7 @@ endif()
# Embedded Lua interpreter
if(ENABLE_LUA)
set(PACKAGELIST ${PACKAGELIST} LUA)
set(LUA_OPTIONS "5.1")
endif()
if(ENABLE_NETLINK)

View File

@ -19,7 +19,7 @@ FindWSWinLibs("lua5*" "LUA_HINTS")
if(NOT WIN32)
find_package(PkgConfig)
pkg_search_module(LUA lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua5.0 lua-5.0 lua50)
pkg_search_module(LUA lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51)
if(NOT LUA_FOUND)
pkg_search_module(LUA "lua<=5.2.99")
endif()
@ -47,8 +47,6 @@ if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
if (LUA_VERSION_NUM)
string(REGEX REPLACE "^#define[ \t]+LUA_VERSION_NUM[ \t]+([0-9]+)" "\\1"
LUA_VERSION_NUM "${LUA_VERSION_NUM}")
else()
set( LUA_VERSION_NUM "500")
endif()
endif()
string( REGEX REPLACE ".*[/\\]lua(.+)$" "\\1" LUA_INC_SUFFIX "${LUA_INCLUDE_DIR}" )
@ -74,7 +72,7 @@ FIND_LIBRARY(LUA_LIBRARY
/opt
)
# Lua 5.3 is not supported, only 5.0/5.1/5.2 are (due to bitops problem)
# Lua 5.3 is not supported, only 5.1/5.2 are (due to bitops problem)
if(LUA_VERSION_NUM GREATER 502)
set(LUA_VERSION_NUM)
endif()