diff options
author | Mattes D <github@xoft.cz> | 2014-07-01 08:54:44 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-07-01 08:54:44 +0200 |
commit | 24c86df12ecf69ae3ddaf707b2116b73c45402cc (patch) | |
tree | 92fe7519642865c344f5efcd974208ac11daea2a /lib | |
parent | Fixed cFile compilation under MinGW. (diff) | |
parent | Proper sqlite dependency fix. (diff) | |
download | cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.gz cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.bz2 cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.lz cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.xz cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.tar.zst cuberite-24c86df12ecf69ae3ddaf707b2116b73c45402cc.zip |
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lua/CMakeLists.txt | 12 | ||||
-rw-r--r-- | lib/sqlite/CMakeLists.txt | 9 | ||||
-rw-r--r-- | lib/tolua++/CMakeLists.txt | 1 |
3 files changed, 13 insertions, 9 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) diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt index 9add2280b..993dac146 100644 --- a/lib/sqlite/CMakeLists.txt +++ b/lib/sqlite/CMakeLists.txt @@ -9,8 +9,14 @@ file(GLOB SOURCE ) -# add headers to MSVC project files: +# Lua is required as a DLL for LuaSQLite: if (WIN32) + add_definitions(-DLUA_BUILD_AS_DLL) +endif() + + +# add headers to MSVC project files: +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}) @@ -23,6 +29,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") endif() add_library(sqlite ${SOURCE}) +target_link_libraries(sqlite lua) if (UNIX) target_link_libraries(sqlite ${DYNAMIC_LOADER}) diff --git a/lib/tolua++/CMakeLists.txt b/lib/tolua++/CMakeLists.txt index 44a4f1c6f..12054323b 100644 --- a/lib/tolua++/CMakeLists.txt +++ b/lib/tolua++/CMakeLists.txt @@ -46,6 +46,7 @@ file(GLOB BIN_SOURCE add_executable(tolua ${BIN_SOURCE}) add_library(tolualib ${LIB_SOURCE}) +target_link_libraries(tolualib lua) #m is the standard math librarys if(UNIX) |