-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.lua52.in
More file actions
36 lines (34 loc) · 2.27 KB
/
CMakeLists.lua52.in
File metadata and controls
36 lines (34 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
set(LUA_VERSION 52)
set(LUA_LIB_TARGET_NAME liblua${LUA_VERSION})
set(LUA_LIB_OUT_NAME lua${LUA_VERSION})
set(LUA_LIB_FILES lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c lcorolib.c lctype.c ldblib.c ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c ltable.c ltablib.c ltm.c lundump.c lvm.c lzio.c)
#
# When you make Lua binding module, it must use the same shared (DLL) version of Lua library as Lua interpreter (or other Lua host program), loaded your module.
# Otherwise, if your module and host program will have separate lua_State's, and when module during some method call create some variable
# (memory will allocate on it's heap) in host program's lua_State, then process will crash, during try to delete such variable in own (other then module) heap
#
# But now we want to become yUnit runner host executable file independent from external libraries, also test unit engine libraries and test containers won't
# have Lua API to yUnit runner, that API will plain C. So we will use static Lua library
#
add_library(${LUA_LIB_TARGET_NAME} ${LUA_LIB_FILES})
set_target_properties(${LUA_LIB_TARGET_NAME} PROPERTIES OUTPUT_NAME ${LUA_LIB_OUT_NAME})
if(WIN32)
set_target_properties(${LUA_LIB_TARGET_NAME} PROPERTIES
OUTPUT_NAME ${LUA_LIB_OUT_NAME}
COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS"
LINK_FLAGS "/PDB:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/liblua${LUA_VERSION}.pdb")
else(WIN32)
if(UNIX)
set_target_properties(${LUA_LIB_TARGET_NAME} PROPERTIES
OUTPUT_NAME ${LUA_LIB_OUT_NAME}
COMPILE_DEFINITIONS "LUA_USE_LINUX")
target_link_libraries(${LUA_LIB_TARGET_NAME} dl ncurses)
else(UNIX)
if(APPLE)
set_target_properties(${LUA_LIB_TARGET_NAME} PROPERTIES
OUTPUT_NAME ${LUA_LIB_OUT_NAME}
COMPILE_DEFINITIONS "LUA_USE_LINUX")
target_link_libraries(${LUA_LIB_TARGET_NAME} dl readline)
endif(APPLE)
endif(UNIX)
endif(WIN32)