Lua: Switch the downloaded Lua to 5.4

This primarily affects cross-compilation (e.g. MinGW)
This commit is contained in:
John Thacker 2024-08-03 09:36:07 -04:00 committed by AndersBroman
parent 9b180d292e
commit e247c146c8
5 changed files with 10 additions and 10 deletions

View File

@ -1437,7 +1437,7 @@ ws_find_package(NGHTTP3 ENABLE_NGHTTP3 HAVE_NGHTTP3)
# Embedded Lua interpreter
if(FETCH_lua)
# Download and build lua
include(${CMAKE_SOURCE_DIR}/cmake/external/lua53/Lua53.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external/lua54/Lua54.cmake)
else()
set(LUA_FIND_VERSIONS "5.4;5.3" CACHE STRING "Lua versions valid for the build (as a list)")
ws_find_package(Lua ENABLE_LUA HAVE_LUA)

View File

@ -26,9 +26,9 @@ set(Lua_FOUND TRUE CACHE INTERNAL "")
# Fresh Lua 5.3+ install always has 64-bit lua_Integers (unlike Lua 5.2)
set(LUA_INTEGER_SIZE 8 CACHE INTERNAL "Size of lua_Integer")
set(_lua53_cflags "-fPIC")
set(_lua54_cflags "-fPIC")
if(APPLE)
set(_lua53_cflags "${lua53_cflags} -isysroot ${CMAKE_OSX_SYSROOT}")
set(_lua54_cflags "${lua54_cflags} -isysroot ${CMAKE_OSX_SYSROOT}")
endif()
#
@ -36,13 +36,13 @@ endif()
# external projects to a staging directory first, and the normal install target
# does not work with MinGW.
#
ExternalProject_Add(lua53
URL https://gitlab.com/wireshark/wireshark-development-libraries/-/raw/main/public/src/lua/lua-5.3.6.tar.gz
URL https://www.lua.org/ftp/lua-5.3.6.tar.gz
URL_HASH SHA256=fc5fd69bb8736323f026672b1b7235da613d7177e72558893a0bdcd320466d60
ExternalProject_Add(lua54
URL https://gitlab.com/wireshark/wireshark-development-libraries/-/raw/main/public/src/lua/lua-5.4.6.tar.gz
URL https://www.lua.org/ftp/lua-5.4.6.tar.gz
URL_HASH SHA256=7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/0001-Add-an-install-static-target.patch
CONFIGURE_COMMAND ""
BUILD_COMMAND ${MAKE_EXE} MYCFLAGS=${_lua53_cflags} CC=${CMAKE_C_COMPILER} AR=${CMAKE_AR}\ rcu RANLIB=${CMAKE_RANLIB} ${_target}
BUILD_COMMAND ${MAKE_EXE} MYCFLAGS=${_lua54_cflags} CC=${CMAKE_C_COMPILER} AR=${CMAKE_AR}\ rcu RANLIB=${CMAKE_RANLIB} ${_target}
BUILD_IN_SOURCE True
BUILD_BYPRODUCTS ${LUA_LIBRARIES}
INSTALL_COMMAND ${MAKE_EXE} INSTALL_TOP=${_staging_dir} install-static

View File

@ -114,7 +114,7 @@ add_library(wslua OBJECT
)
if(FETCH_lua)
add_dependencies(wslua lua53)
add_dependencies(wslua lua54)
endif()
target_include_directories(wslua

View File

@ -21,7 +21,7 @@ target_include_directories(lrexlib SYSTEM PRIVATE
add_dependencies(lrexlib register_wslua)
if(FETCH_lua)
add_dependencies(lrexlib lua53)
add_dependencies(lrexlib lua54)
endif()
add_compile_definitions(