2023-04-02 15:31:53 +02:00
|
|
|
project(lua CXX)
|
|
|
|
|
|
|
|
#[====[
|
2024-09-04 13:30:08 +02:00
|
|
|
This list contains all .c files except lua.c and onelua.c
|
|
|
|
Use the following command from the repository root to get these file:
|
|
|
|
perl -e 'print s/^lib\/lua\///r . "\n" for grep { /\.c$/ && !/(lua|onelua)\.c$/ } glob "lib/lua/src/*.c"'
|
2023-04-02 15:31:53 +02:00
|
|
|
#]====]
|
|
|
|
set(LUA_SRC
|
2024-09-04 13:30:08 +02:00
|
|
|
src/lapi.c
|
|
|
|
src/lauxlib.c
|
|
|
|
src/lbaselib.c
|
|
|
|
src/lcode.c
|
|
|
|
src/lcorolib.c
|
|
|
|
src/lctype.c
|
|
|
|
src/ldblib.c
|
|
|
|
src/ldebug.c
|
|
|
|
src/ldo.c
|
|
|
|
src/ldump.c
|
|
|
|
src/lfunc.c
|
|
|
|
src/lgc.c
|
|
|
|
src/linit.c
|
|
|
|
src/liolib.c
|
|
|
|
src/llex.c
|
|
|
|
src/lmathlib.c
|
|
|
|
src/lmem.c
|
|
|
|
src/loadlib.c
|
|
|
|
src/lobject.c
|
|
|
|
src/lopcodes.c
|
|
|
|
src/loslib.c
|
|
|
|
src/lparser.c
|
|
|
|
src/lstate.c
|
|
|
|
src/lstring.c
|
|
|
|
src/lstrlib.c
|
|
|
|
src/ltable.c
|
|
|
|
src/ltablib.c
|
|
|
|
src/ltests.c
|
|
|
|
src/ltm.c
|
|
|
|
src/lundump.c
|
|
|
|
src/lutf8lib.c
|
|
|
|
src/lvm.c
|
|
|
|
src/lzio.c
|
2023-04-02 15:31:53 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(lua STATIC ${LUA_SRC})
|
|
|
|
target_include_directories(lua
|
|
|
|
PUBLIC
|
|
|
|
${LUA_INCLUDE_DIRS}
|
|
|
|
)
|
2024-09-04 13:30:08 +02:00
|
|
|
set_target_properties(${liblua} PROPERTIES
|
|
|
|
LANGUAGE CXX
|
|
|
|
LINKER_LANGUAGE CXX
|
|
|
|
CXX_STANDARD 98
|
|
|
|
CXX_EXTENSIONS TRUE
|
|
|
|
)
|
2024-10-14 17:36:29 +02:00
|
|
|
target_compile_options(lua PRIVATE -w) # this makes clang shut up about c-as-c++
|
2024-09-04 13:30:08 +02:00
|
|
|
set_source_files_properties(${LUA_SRC} PROPERTIES LANGUAGE CXX)
|