Made cmake compilation possible on Windows.
This commit is contained in:
@@ -8,12 +8,23 @@ file(GLOB SOURCE
|
||||
"src/*.c"
|
||||
)
|
||||
|
||||
if(${STATIC_LUA})
|
||||
add_library(lua ${SOURCE})
|
||||
else()
|
||||
add_library(lua SHARED ${SOURCE})
|
||||
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/src/lua.c" "${PROJECT_SOURCE_DIR}/src/luac.c")
|
||||
|
||||
# add headers to MSVC project files:
|
||||
if (WIN32)
|
||||
file(GLOB HEADERS "src/*.h")
|
||||
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/src/lua.h" "${PROJECT_SOURCE_DIR}/src/luac.h")
|
||||
set(SOURCE ${SOURCE} ${HEADERS})
|
||||
source_group("Sources" FILES ${SOURCE})
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
target_link_libraries(lua m dl)
|
||||
# Lua needs to be linked dynamically on Windows and statically on *nix, so that LuaRocks work
|
||||
if (WIN32)
|
||||
add_library(lua SHARED ${SOURCE})
|
||||
else()
|
||||
add_library(lua ${SOURCE})
|
||||
endif()
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(m dl)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user