Skip to content

Commit

Permalink
Rely on system Lua instead of shipping it
Browse files Browse the repository at this point in the history
A specific version of Lua used to be required, but this is no longer the case
(I think after commit 5aae933/PR longturn#417). Use the version of Lua provided by the
system, requiring at least and prioritizing the widely available Lua 5.3.

This should fix longturn#504.
  • Loading branch information
lmoureaux committed Jul 19, 2021
1 parent d6bc1c2 commit 2611743
Show file tree
Hide file tree
Showing 71 changed files with 18 additions and 28,047 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- gettext
- qt5-default
- libkf5archive-dev
- liblua5.3-dev
- libsqlite3-dev
- libsdl2-mixer-dev
- name: "ubuntu-clang"
Expand All @@ -38,6 +39,7 @@ jobs:
- gettext
- qt5-default
- libkf5archive-dev
- liblua5.3-dev
- libsqlite3-dev
- libsdl2-mixer-dev
before_script:
Expand All @@ -55,6 +57,7 @@ jobs:
mingw-w64-x86_64-gcc
mingw-w64-x86_64-libunwind
mingw-w64-x86_64-readline
mingw-w64-x86_64-lua # There is no lua53 in MSYS, 5.4 should work...
mingw-w64-x86_64-SDL2_mixer
mingw-w64-x86_64-qt5
mingw-w64-x86_64-karchive-qt5
Expand Down Expand Up @@ -82,6 +85,7 @@ jobs:
- qt@5
- kde-karchive
- readline
- [email protected]
- sqlite
- sdl2
- sdl2_mixer
Expand All @@ -101,6 +105,7 @@ jobs:
- gettext
- qt5-default
- libkf5archive-dev
- liblua5.3-dev
- libsqlite3-dev
- libsdl2-mixer-dev
coverity_scan:
Expand Down
16 changes: 13 additions & 3 deletions cmake/FreecivDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,29 @@ endif()

# Lua
#
# Lua is not binary compatible even between minor releases. We stick to Lua 5.4.
# Lua is not binary compatible even between minor releases. We stick to Lua 5.3.
#
# The tolua program is compatible with Lua 5.4, but the library may not be (eg
# The tolua program is compatible with Lua 5.3, but the library may not be (eg
# on Debian it's linked to Lua 5.2). We always build the library. When not
# cross-compiling, we can also build the program. When cross-compiling, an
# externally provided tolua program is required (or an emulator for the target
# platform, eg qemu).
find_package(Lua 5.3 REQUIRED)

# Create an imported target since it's not created by CMake :(
add_library(lua SHARED IMPORTED GLOBAL)
# Get a library name for IMPORTED_LOCATION
list(GET LUA_LIBRARIES 0 loc)
set_target_properties(lua PROPERTIES IMPORTED_LOCATION "${loc}")
# Link to all libs, not just the first
target_link_libraries(lua INTERFACE "${LUA_LIBRARIES}")
target_include_directories(lua SYSTEM INTERFACE "${LUA_INCLUDE_DIR}")

if (CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING_EMULATOR)
find_package(ToLuaProgram REQUIRED)
else()
find_package(ToLuaProgram)
endif()
add_subdirectory(dependencies/lua-5.4)
add_subdirectory(dependencies/tolua-5.2) # Will build the program if not found.

# backward-cpp
Expand Down
1 change: 0 additions & 1 deletion dependencies/lua-5.4/CMakeLists.txt

This file was deleted.

6 changes: 0 additions & 6 deletions dependencies/lua-5.4/README

This file was deleted.

6 changes: 0 additions & 6 deletions dependencies/lua-5.4/Version

This file was deleted.

Binary file removed dependencies/lua-5.4/doc/logo.gif
Binary file not shown.
Binary file removed dependencies/lua-5.4/doc/osi-certified-72x60.png
Binary file not shown.
Loading

0 comments on commit 2611743

Please sign in to comment.