mirror of
https://github.com/walterschell/Lua.git
synced 2024-11-15 12:15:43 +08:00
Added ability to compile lua as C++
This commit is contained in:
parent
06f57db5d6
commit
be9aad4a56
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.1)
|
||||
project(lua LANGUAGES C VERSION 5.4.2)
|
||||
|
||||
option(LUA_SUPPORT_DL "Support dynamic loading of compiled modules" OFF)
|
||||
option(LUA_BUILD_AS_CXX "Build lua as C++" OFF)
|
||||
|
||||
if(${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
|
||||
set(TOP_LEVEL TRUE)
|
||||
|
@ -33,6 +33,10 @@ set(LUA_LIB_SRCS
|
||||
"src/linit.c"
|
||||
)
|
||||
|
||||
if(LUA_BUILD_AS_CXX)
|
||||
SET_SOURCE_FILES_PROPERTIES(${LUA_LIB_SRCS} PROPERTIES LANGUAGE CXX )
|
||||
endif()
|
||||
|
||||
add_library(lua_static STATIC ${LUA_LIB_SRCS})
|
||||
set_target_properties(lua_static PROPERTIES OUTPUT_NAME "lua")
|
||||
target_include_directories(lua_static PUBLIC "include")
|
||||
|
Loading…
Reference in New Issue
Block a user