Skip to content

Commit

Permalink
Compile Lua 5.1.5 on our own
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Feb 25, 2024
1 parent b4dcec9 commit 3f76f6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ add_compile_definitions(
set(STRATAGUS_VERSION ${CMAKE_PROJECT_VERSION})

add_subdirectory(archimedes)
add_subdirectory(src/third_party/lua-5.1.5)
add_subdirectory(src/third_party/toluapp)
add_subdirectory(src/third_party/zlib)

Expand All @@ -53,6 +54,7 @@ include_directories(
src/guichan/include/guichan
src/stratagus
src/third_party
src/third_party/lua-5.1.5/src
src/third_party/toluapp/include
src/third_party/xbrz/include
src/third_party/zlib
Expand Down Expand Up @@ -1365,7 +1367,6 @@ find_package(Qt6 6.5 COMPONENTS Location REQUIRED) #licensed under the GPL 2.0 (
find_package(Qt6 6.5 COMPONENTS Qml REQUIRED) #licensed under the GPL 2.0 (as well as the LGPL 3.0)
find_package(Qt6 6.5 COMPONENTS Quick REQUIRED) #licensed under the GPL 2.0 (as well as the LGPL 3.0)

find_package(Lua51 REQUIRED)
find_package(SDL2 REQUIRED)
find_package(SDL2_mixer REQUIRED)

Expand Down Expand Up @@ -1439,7 +1440,6 @@ endif()

add_definitions(-DUSE_ZLIB -DPIXMAPS=\"${PIXMAPSDIRABS}\")
include_directories(
${LUA_INCLUDE_DIR}
${SDL2_INCLUDE_DIR}
${SDL2_MIXER_INCLUDE_DIR}
)
Expand All @@ -1455,9 +1455,9 @@ set(QT_LIBRARIES
)

set(wyrmgus_LIBS
${LUA_LIBRARIES}
${SDL2_LIBRARY}
${SDL2_MIXER_LIBRARY}
lua51_static
zlibstatic
toluapp_lib
${QT_LIBRARIES}
Expand Down
7 changes: 3 additions & 4 deletions src/third_party/toluapp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ project ( toluapp C )
cmake_minimum_required ( VERSION 2.8 )
include ( cmake/dist.cmake )

find_package ( Lua REQUIRED )
include_directories ( include src/lib ${LUA_INCLUDE_DIR} )
include_directories ( include src/lib ../lua-5.1.5/src)

# Build lib
file ( GLOB SRC_LIBTOLUAPP src/lib/*.c )
Expand All @@ -18,15 +17,15 @@ if ( MSVC )
endif ( )

add_library ( toluapp_lib ${SRC_LIBTOLUAPP} ${DEF_FILE} )
target_link_libraries ( toluapp_lib ${LUA_LIBRARIES} )
target_link_libraries ( toluapp_lib lua51_static )
set_target_properties ( toluapp_lib PROPERTIES OUTPUT_NAME toluapp CLEAN_DIRECT_OUTPUT
1 )

# Build app
include_directories ( src/bin )
set ( SRC_TOLUA src/bin/tolua.c src/bin/toluabind.c )
add_executable ( toluapp ${SRC_TOLUA} )
target_link_libraries ( toluapp toluapp_lib ${LUA_LIBRARIES} )
target_link_libraries ( toluapp toluapp_lib lua51_static )

# Install
install_library ( toluapp_lib )
Expand Down

0 comments on commit 3f76f6d

Please sign in to comment.