2016-09-22 21:39:06 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2021-03-11 04:46:07 +08:00
|
|
|
project(lua LANGUAGES C VERSION 5.4.2)
|
2020-06-30 20:52:34 +08:00
|
|
|
|
2020-06-30 21:29:24 +08:00
|
|
|
option(LUA_SUPPORT_DL "Support dynamic loading of compiled modules" OFF)
|
|
|
|
|
2020-06-30 20:52:34 +08:00
|
|
|
if(${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
|
|
|
|
set(TOP_LEVEL TRUE)
|
|
|
|
else()
|
|
|
|
set(TOP_LEVEL FALSE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(TOP_LEVEL)
|
|
|
|
option(LUA_BUILD_BINARY "Build lua binary" ON)
|
|
|
|
option(LUA_BUILD_COMPILER "Build luac compiler" ON)
|
|
|
|
else()
|
|
|
|
option(LUA_BUILD_BINARY "Build lua binary" OFF)
|
|
|
|
option(LUA_BUILD_COMPILER "Build luac compiler" ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2021-03-11 04:46:07 +08:00
|
|
|
add_subdirectory(lua-5.4.2)
|