summaryrefslogtreecommitdiffstats
path: root/lib/lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-06-30 21:27:13 +0200
committerMattes D <github@xoft.cz>2014-06-30 21:42:20 +0200
commitac01a8e483f84d94f57c38d6882acd31d7e0fc91 (patch)
tree801c8cb02149d84982a55dcdc56ecf3e9fc6b15d /lib/lua
parentFixed cFile compilation under MinGW. (diff)
downloadcuberite-ac01a8e483f84d94f57c38d6882acd31d7e0fc91.tar
cuberite-ac01a8e483f84d94f57c38d6882acd31d7e0fc91.tar.gz
cuberite-ac01a8e483f84d94f57c38d6882acd31d7e0fc91.tar.bz2
cuberite-ac01a8e483f84d94f57c38d6882acd31d7e0fc91.tar.lz
cuberite-ac01a8e483f84d94f57c38d6882acd31d7e0fc91.tar.xz
cuberite-ac01a8e483f84d94f57c38d6882acd31d7e0fc91.tar.zst
cuberite-ac01a8e483f84d94f57c38d6882acd31d7e0fc91.zip
Diffstat (limited to '')
-rw-r--r--lib/lua/CMakeLists.txt12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/lua/CMakeLists.txt b/lib/lua/CMakeLists.txt
index 6e5e0f565..0a04d1ee6 100644
--- a/lib/lua/CMakeLists.txt
+++ b/lib/lua/CMakeLists.txt
@@ -11,21 +11,16 @@ file(GLOB 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)
+if (MSVC)
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()
+
# Lua needs to be linked dynamically on Windows and statically on *nix, so that LuaRocks work
if (WIN32)
-
- #for compiliers other than msvc we need to tell lua that its building as a dll
- if (NOT MSVC)
- add_flags_cxx(-DLUA_BUILD_AS_DLL=1)
- endif()
-
add_library(lua SHARED ${SOURCE})
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/MCServer)
@@ -53,7 +48,7 @@ if (WIN32)
)
endif()
- set_target_properties(lua PROPERTIES OUTPUT_NAME "lua51")
+ set_target_properties(lua PROPERTIES OUTPUT_NAME "lua51" PREFIX "")
# NOTE: The DLL for each configuration is stored at the same place, thus overwriting each other.
# This is known, however such behavior is needed for LuaRocks - they always load "lua5.1.dll" or "lua51.dll"
@@ -63,6 +58,7 @@ else()
add_library(lua ${SOURCE})
endif()
+
# Tell Lua what dynamic loader to use (for LuaRocks):
if (UNIX)
add_definitions(-DLUA_USE_DLOPEN)