Skip to content

Commit

Permalink
Reworked how tolua++ is compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Feb 25, 2024
1 parent 3f76f6d commit f3bfdd3
Show file tree
Hide file tree
Showing 124 changed files with 56 additions and 20,454 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ 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)

# Stratagus sources
Expand All @@ -55,7 +54,7 @@ include_directories(
src/stratagus
src/third_party
src/third_party/lua-5.1.5/src
src/third_party/toluapp/include
src/third_party/lua-5.1.5/toluapp-simple
src/third_party/xbrz/include
src/third_party/zlib
${CMAKE_CURRENT_BINARY_DIR}
Expand Down Expand Up @@ -1459,7 +1458,7 @@ set(wyrmgus_LIBS
${SDL2_MIXER_LIBRARY}
lua51_static
zlibstatic
toluapp_lib
toluapp51
${QT_LIBRARIES}
archimedes
)
Expand Down
2 changes: 1 addition & 1 deletion src/third_party/lua-5.1.5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ project(lua)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(src/)

add_subdirectory(toluapp-simple/)
53 changes: 53 additions & 0 deletions src/third_party/lua-5.1.5/toluapp-simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
cmake_minimum_required(VERSION 3.1)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

set(TOLUA_BIN_SRC
tolua.c
toluabind.c
)

set(TOLUA_LIB_SRC
tolua_event.c
tolua_is.c
tolua_map.c
tolua_push.c
tolua_to.c
)


add_library(toluapp51 STATIC "${TOLUA_LIB_SRC}")
add_library(toluapp51_shared SHARED "${TOLUA_LIB_SRC}")
set_target_properties(toluapp51_shared PROPERTIES OUTPUT_NAME "toluapp51")
add_executable(toluapp "${TOLUA_BIN_SRC}" "${TOLUA_LIB_SRC}")

if(MSVC)
target_link_libraries(toluapp51 PUBLIC "${PROJECT_BINARY_DIR}/$<CONFIGURATION>/lua51.lib" ${CMAKE_DL_LIBS})
target_link_libraries(toluapp51_shared PUBLIC "${PROJECT_BINARY_DIR}/$<CONFIGURATION>/lua51.lib" ${CMAKE_DL_LIBS})
target_link_libraries(toluapp PUBLIC "${PROJECT_BINARY_DIR}/$<CONFIGURATION>/lua51.lib" ${CMAKE_DL_LIBS})
else()
target_link_libraries(toluapp51 PUBLIC "${PROJECT_BINARY_DIR}/liblua51.a" ${CMAKE_DL_LIBS})
target_link_libraries(toluapp51_shared PUBLIC "${PROJECT_BINARY_DIR}/liblua51.a" ${CMAKE_DL_LIBS})
target_link_libraries(toluapp PUBLIC "${PROJECT_BINARY_DIR}/liblua51.a" ${CMAKE_DL_LIBS})
endif(MSVC)

add_custom_command(TARGET toluapp51 POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/toluapp-simple/tolua++.h" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

set_target_properties(toluapp PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}
)

set_target_properties(toluapp51 PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(toluapp51_shared PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(toluapp PROPERTIES LINKER_LANGUAGE CXX)

add_dependencies(toluapp51_shared lua51 lua51_shared lua51_static)
add_dependencies(toluapp51 lua51 lua51_shared lua51_static)
add_dependencies(toluapp lua51 lua51_shared lua51_static)

include_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 0 additions & 51 deletions src/third_party/toluapp/.travis.yml

This file was deleted.

35 changes: 0 additions & 35 deletions src/third_party/toluapp/CMakeLists.txt

This file was deleted.

42 changes: 0 additions & 42 deletions src/third_party/toluapp/INSTALL

This file was deleted.

5 changes: 0 additions & 5 deletions src/third_party/toluapp/Makefile

This file was deleted.

30 changes: 0 additions & 30 deletions src/third_party/toluapp/README

This file was deleted.

50 changes: 0 additions & 50 deletions src/third_party/toluapp/README-5.1

This file was deleted.

Loading

0 comments on commit f3bfdd3

Please sign in to comment.