From ac01a8e483f84d94f57c38d6882acd31d7e0fc91 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 30 Jun 2014 21:27:13 +0200 Subject: Fixed lua compilation under MinGW. --- lib/lua/CMakeLists.txt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3 From 84272fb155d48f999441b7aaba9ca8b21584ad21 Mon Sep 17 00:00:00 2001 From: worktycho Date: Mon, 30 Jun 2014 22:21:07 +0100 Subject: Added dependecy of tolualib on lua --- lib/tolua++/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/tolua++/CMakeLists.txt b/lib/tolua++/CMakeLists.txt index 44a4f1c6f..56ffc0dc1 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_library(tolualib lua) #m is the standard math librarys if(UNIX) -- cgit v1.2.3 From 0fb236bfe46782dc4e7c5b76db7b7c25671e3d66 Mon Sep 17 00:00:00 2001 From: worktycho Date: Mon, 30 Jun 2014 22:21:22 +0100 Subject: typo --- lib/tolua++/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tolua++/CMakeLists.txt b/lib/tolua++/CMakeLists.txt index 56ffc0dc1..12054323b 100644 --- a/lib/tolua++/CMakeLists.txt +++ b/lib/tolua++/CMakeLists.txt @@ -46,7 +46,7 @@ file(GLOB BIN_SOURCE add_executable(tolua ${BIN_SOURCE}) add_library(tolualib ${LIB_SOURCE}) -target_link_library(tolualib lua) +target_link_libraries(tolualib lua) #m is the standard math librarys if(UNIX) -- cgit v1.2.3 From 4f60f5aef4517d6d3eaf2ea9f7aae30e6a97da25 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 1 Jul 2014 06:40:38 +0200 Subject: Fixed linking order under MinGW. Ref.: #1044 --- lib/sqlite/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt index 9add2280b..48bb5f15c 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}) @@ -25,5 +31,5 @@ endif() add_library(sqlite ${SOURCE}) if (UNIX) - target_link_libraries(sqlite ${DYNAMIC_LOADER}) + target_link_libraries(sqlite ${DYNAMIC_LOADER} lua) endif() -- cgit v1.2.3 From eb8244f1c286ec33c30ba205eb5cebc1f2a0430d Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 1 Jul 2014 08:01:39 +0200 Subject: Proper sqlite dependency fix. --- lib/sqlite/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt index 48bb5f15c..993dac146 100644 --- a/lib/sqlite/CMakeLists.txt +++ b/lib/sqlite/CMakeLists.txt @@ -29,7 +29,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") endif() add_library(sqlite ${SOURCE}) +target_link_libraries(sqlite lua) if (UNIX) - target_link_libraries(sqlite ${DYNAMIC_LOADER} lua) + target_link_libraries(sqlite ${DYNAMIC_LOADER}) endif() -- cgit v1.2.3