# HG changeset patch # User koda # Date 1370993202 -7200 # Node ID abce6011f86c474bcb529bf6b64e63059077bd37 # Parent 1c233176fffd3e5dfa159ab1d51c5552179e50cd aaaaand let's not forget about lua, which has also a slightly revised build process diff -r 1c233176fffd -r abce6011f86c CMakeLists.txt --- a/CMakeLists.txt Wed Jun 12 01:04:30 2013 +0200 +++ b/CMakeLists.txt Wed Jun 12 01:26:42 2013 +0200 @@ -141,8 +141,6 @@ else() message(STATUS "LUA will be provided by the bundled sources") add_subdirectory(misc/liblua) - #linking with liblua.a requires system readline - list(APPEND pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline") endif() diff -r 1c233176fffd -r abce6011f86c hedgewars/LuaPas.pas --- a/hedgewars/LuaPas.pas Wed Jun 12 01:04:30 2013 +0200 +++ b/hedgewars/LuaPas.pas Wed Jun 12 01:26:42 2013 +0200 @@ -14,6 +14,9 @@ uses uConsts; {.$DEFINE LUA_GETHOOK} +{$INCLUDE "config.inc"} +const LuaLibName = cLuaLibrary; + type size_t = Cardinal; Psize_t = ^size_t; @@ -22,9 +25,6 @@ lua_State = record end; Plua_State = ^lua_State; -{$DEFINE LuaLibName:= cLuaLibrary} - - (*****************************************************************************) (* luaconfig.h *) (*****************************************************************************) diff -r 1c233176fffd -r abce6011f86c hedgewars/uScript.pas --- a/hedgewars/uScript.pas Wed Jun 12 01:04:30 2013 +0200 +++ b/hedgewars/uScript.pas Wed Jun 12 01:26:42 2013 +0200 @@ -54,6 +54,11 @@ implementation {$IFDEF USE_LUA_SCRIPT} + +{$IFNDEF WIN32} + {$linklib lua} +{$ENDIF} + uses LuaPas, uConsole, uConsts, diff -r 1c233176fffd -r abce6011f86c misc/liblua/CMakeLists.txt --- a/misc/liblua/CMakeLists.txt Wed Jun 12 01:04:30 2013 +0200 +++ b/misc/liblua/CMakeLists.txt Wed Jun 12 01:26:42 2013 +0200 @@ -4,17 +4,22 @@ if(WIN32) add_definitions(-DLUA_BUILD_AS_DLL) - add_library(lua SHARED ${lua_src}) - - set(LUA_LIBRARY lua.dll) - - set_target_properties(lua PROPERTIES PREFIX "") - install(TARGETS lua RUNTIME DESTINATION ${target_library_install_dir}) else(WIN32) add_definitions(-DLUA_USE_LINUX) - add_library(lua STATIC ${lua_src}) - set(LUA_LIBRARY lua) + add_definitions(-fvisibility=default) #TODO: fixme endif(WIN32) +add_library(lua ${lua_src}) + +set_target_properties(lua PROPERTIES + VERSION "5.1.4" + SOVERSION 1) +install(TARGETS lua RUNTIME DESTINATION ${target_binary_install_dir} + LIBRARY DESTINATION ${target_library_install_dir} + ARCHIVE DESTINATION ${target_library_install_dir}) +get_target_property(lua_fullpath lua LOCATION) + +set(LUA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "" FORCE) +set(LUA_LIBRARY ${lua_fullpath} CACHE STRING "" FORCE)