Skip to content

Commit

Permalink
Change Lua library dependancy
Browse files Browse the repository at this point in the history
-Change Lua library to allow LuaJIT
  • Loading branch information
Niam5 committed Sep 25, 2023
1 parent 6e71153 commit e63c8e0
Show file tree
Hide file tree
Showing 64 changed files with 339 additions and 20,289 deletions.
44 changes: 22 additions & 22 deletions dep/lualib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#
# Copyright (C) 2010 - 2014 Eluna Lua Engine <http://emudevs.com/>
# This program is free software licensed under GPL version 3
# Please see the included DOCS/LICENSE.md for more information
#
set(LIBRARY_NAME lualib)
set(LUA_VERSION "lua52" CACHE STRING "Lua version to use")
set_property(CACHE LUA_VERSION PROPERTY STRINGS luajit lua51 lua52 lua53 lua54)
MESSAGE(STATUS "Lua version: ${LUA_VERSION}")

# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()

file(GLOB sources *.c)
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/lua.c)
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/luac.c)
if (WIN32)
option(LUA_STATIC "link lua statically" ON)
else()
option(LUA_STATIC "link lua statically" OFF)
endif()

set(lua_STAT_SRCS
${sources}
)
if (LUA_STATIC)
MESSAGE(STATUS "Lua linking: static")
else()
MESSAGE(STATUS "Lua linking: dynamic")
endif()

add_library(lualib STATIC ${lua_STAT_SRCS})


target_include_directories(lualib
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR})

if(MSVC)
set_target_properties(${LIBRARY_NAME} PROPERTIES FOLDER "Dependencies")
endif()
if (LUA_VERSION MATCHES "luajit")
add_subdirectory(luajit)
else()
add_subdirectory(lua)
endif()
Loading

0 comments on commit e63c8e0

Please sign in to comment.