2012-03-24 05:13:51 -06:00
|
|
|
PROJECT ( lua CXX )
|
2011-08-08 15:19:44 -06:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
|
|
|
|
2012-04-16 08:32:12 -06:00
|
|
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLUA_USE_APICHECK")
|
2012-03-23 00:56:29 -06:00
|
|
|
|
2016-08-09 16:49:39 -06:00
|
|
|
# Make bit32 library available (for things like bit32.extract())
|
|
|
|
ADD_DEFINITIONS(-DLUA_COMPAT_BITLIB)
|
|
|
|
|
2011-08-08 15:19:44 -06:00
|
|
|
IF(WIN32)
|
2018-04-06 20:22:48 -06:00
|
|
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE /wd4334 )
|
2011-08-08 15:19:44 -06:00
|
|
|
ELSE()
|
|
|
|
ADD_DEFINITIONS ( -DLUA_USE_POSIX -DLUA_USE_DLOPEN )
|
|
|
|
SET ( LIBS m dl )
|
|
|
|
ENDIF()
|
|
|
|
|
2011-08-08 15:30:30 -06:00
|
|
|
IF(UNIX)
|
2016-07-03 21:32:43 -06:00
|
|
|
ADD_DEFINITIONS(-DLINUX_BUILD)
|
|
|
|
IF(DFHACK_BUILD_64)
|
|
|
|
SET(CMAKE_C_FLAGS "-m64 -mno-avx")
|
|
|
|
ELSE()
|
|
|
|
SET(CMAKE_C_FLAGS "-m32")
|
|
|
|
ENDIF()
|
2011-08-08 15:30:30 -06:00
|
|
|
ENDIF()
|
|
|
|
|
2012-03-13 07:46:48 -06:00
|
|
|
SET (HDR_LIBLUA
|
|
|
|
include/lapi.h
|
|
|
|
include/lauxlib.h
|
|
|
|
include/lcode.h
|
2012-03-31 02:11:43 -06:00
|
|
|
include/lctype.h
|
2012-03-13 07:46:48 -06:00
|
|
|
include/ldebug.h
|
|
|
|
include/ldo.h
|
|
|
|
include/lfunc.h
|
|
|
|
include/lgc.h
|
|
|
|
include/llex.h
|
|
|
|
include/llimits.h
|
|
|
|
include/lmem.h
|
|
|
|
include/lobject.h
|
|
|
|
include/lopcodes.h
|
|
|
|
include/lparser.h
|
|
|
|
include/lstate.h
|
|
|
|
include/lstring.h
|
|
|
|
include/ltable.h
|
|
|
|
include/ltm.h
|
|
|
|
include/lua.h
|
|
|
|
include/luaconf.h
|
|
|
|
include/lualib.h
|
|
|
|
include/lundump.h
|
|
|
|
include/lvm.h
|
|
|
|
include/lzio.h
|
|
|
|
)
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${HDR_LIBLUA} PROPERTIES HEADER_FILE_ONLY TRUE)
|
|
|
|
include_directories(include)
|
|
|
|
|
2011-08-08 15:19:44 -06:00
|
|
|
# Build Libraries
|
|
|
|
SET (SRC_LIBLUA
|
|
|
|
src/lapi.c
|
2011-08-13 16:09:59 -06:00
|
|
|
src/lauxlib.c
|
|
|
|
src/lbaselib.c
|
2012-03-31 02:11:43 -06:00
|
|
|
src/lbitlib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/lcode.c
|
2012-03-31 02:11:43 -06:00
|
|
|
src/lcorolib.c
|
|
|
|
src/lctype.c
|
2011-08-13 16:09:59 -06:00
|
|
|
src/ldblib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/ldebug.c
|
|
|
|
src/ldo.c
|
|
|
|
src/ldump.c
|
|
|
|
src/lfunc.c
|
|
|
|
src/lgc.c
|
2011-08-13 16:09:59 -06:00
|
|
|
src/linit.c
|
|
|
|
src/liolib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/llex.c
|
2011-08-13 16:09:59 -06:00
|
|
|
src/lmathlib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/lmem.c
|
2011-08-13 16:09:59 -06:00
|
|
|
src/loadlib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/lobject.c
|
|
|
|
src/lopcodes.c
|
2011-08-13 16:09:59 -06:00
|
|
|
src/loslib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/lparser.c
|
|
|
|
src/lstate.c
|
|
|
|
src/lstring.c
|
2011-08-13 16:09:59 -06:00
|
|
|
src/lstrlib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/ltable.c
|
2011-08-13 16:09:59 -06:00
|
|
|
src/ltablib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/ltm.c
|
|
|
|
src/lundump.c
|
2016-07-26 21:29:26 -06:00
|
|
|
src/lutf8lib.c
|
2011-08-08 15:19:44 -06:00
|
|
|
src/lvm.c
|
|
|
|
src/lzio.c
|
|
|
|
)
|
2012-03-24 05:13:51 -06:00
|
|
|
# compile with C++ compiler
|
|
|
|
set_source_files_properties(${SRC_LIBLUA} PROPERTIES LANGUAGE CXX)
|
|
|
|
# append headers to sources to make them show up in MSVC GUI
|
2012-03-13 07:46:48 -06:00
|
|
|
LIST(APPEND SRC_LIBLUA ${HDR_LIBLUA})
|
2011-08-08 15:19:44 -06:00
|
|
|
|
2012-03-24 05:13:51 -06:00
|
|
|
ADD_LIBRARY ( lua SHARED ${SRC_LIBLUA} )
|
2011-08-08 15:19:44 -06:00
|
|
|
TARGET_LINK_LIBRARIES ( lua ${LIBS})
|
2012-03-19 10:12:27 -06:00
|
|
|
|
|
|
|
install(TARGETS lua
|
|
|
|
LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION}
|
|
|
|
RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION})
|
|
|
|
|
2012-03-13 07:46:48 -06:00
|
|
|
IDE_FOLDER(lua "Depends")
|
2011-08-08 15:19:44 -06:00
|
|
|
|
|
|
|
#SET ( SRC_LUA src/lua.c )
|
|
|
|
#SET ( SRC_LUAC src/luac.c src/print.c )
|
|
|
|
|
|
|
|
#ADD_EXECUTABLE ( lua ${SRC_LUA} ${LUA_RC_FILE})
|
|
|
|
#ADD_EXECUTABLE ( luac ${SRC_LUAC} ${LUAC_RC_FILE})
|
|
|
|
#TARGET_LINK_LIBRARIES ( lua liblua )
|
|
|
|
#TARGET_LINK_LIBRARIES ( luac liblua_static )
|
|
|
|
|