# Lua 5.4.7 amalgamated static lib (MIT). Sin entry points (lua.c/luac.c).
file(GLOB LUA_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
add_library(lua54 STATIC ${LUA_SRC})
target_include_directories(lua54 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(lua54 PUBLIC LUA_USE_C89)
# Linux: add dl for loadlib (we sandbox loadlib later but lib still references)
if(UNIX AND NOT WIN32)
    target_link_libraries(lua54 PUBLIC m dl)
endif()
