mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Features(Lualib/Lua(Jit)): Lua Version and Static Linking Support (#209)
This commit is contained in:
25
CMakeLists.txt
Normal file
25
CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
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()
|
||||
|
||||
option(LUA_STATIC "link lua statically" OFF)
|
||||
if (LUA_STATIC)
|
||||
MESSAGE(STATUS "Lua linking: static")
|
||||
else()
|
||||
MESSAGE(STATUS "Lua linking: dynamic")
|
||||
endif()
|
||||
|
||||
if (LUA_VERSION MATCHES "luajit")
|
||||
add_subdirectory(src/lualib/luajit)
|
||||
set(LUAJIT_VERSION true)
|
||||
else()
|
||||
add_subdirectory(src/lualib/lua)
|
||||
set(LUAJIT_VERSION false)
|
||||
endif()
|
||||
|
||||
set_target_properties(lualib PROPERTIES INTERFACE_COMPILE_DEFINITIONS LUAJIT_VERSION)
|
||||
Reference in New Issue
Block a user