forked from satoren/kaguya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLua-CMakeLists.txt
35 lines (26 loc) · 873 Bytes
/
Lua-CMakeLists.txt
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
cmake_minimum_required (VERSION 2.6)
project (lua)
file(GLOB LIB_LUA_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
src/*.h
src/*.c
include/*.h)
include_directories("src/")
include_directories("include/")
list(REMOVE_ITEM LIB_LUA_SRCS src/lua.c src/luac.c)
add_library(liblua STATIC ${LIB_LUA_SRCS})
SET_TARGET_PROPERTIES(liblua PROPERTIES OUTPUT_NAME lua)
if(NOT EMSCRIPTEN)
add_library(liblua_shared SHARED ${LIB_LUA_SRCS})
if(MSVC)
target_compile_definitions(liblua_shared PRIVATE "-DLUA_BUILD_AS_DLL")
endif(MSVC)
endif(NOT EMSCRIPTEN)
if(UNIX AND NOT EMSCRIPTEN)
add_definitions("-DLUA_USE_POSIX -DLUA_USE_DLOPEN")
target_link_libraries(liblua m dl)
target_link_libraries(liblua_shared m dl)
endif(UNIX AND NOT EMSCRIPTEN)
#add_executable(lua src/lua.c)
#target_link_libraries(lua liblua)
#add_executable(luac src/luac.c)
#target_link_libraries(luac liblua)