Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 954 for code


Ignore:
Timestamp:
Mar 29, 2008, 5:20:08 PM (17 years ago)
Author:
bknecht
Message:

lua linking works now (v 5.1 and 5.0). not tested on tardis and will not work on windows

Location:
code/branches/script
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/script/cmake/FindLua.cmake

    r946 r954  
    1919        /usr/local/include/lua5.1)
    2020
    21 FIND_PATH(Lua_INCLUDE_DIR lauxlib.h
    22         /usr/include/lua5.1
    23         /usr/local/include/lua5.1)
    24 
    25 FIND_PATH(Lua_INCLUDE_DIR lualib.h
    26         /usr/include/lua5.1
    27         /usr/local/include/lua5.1)
    28 
    29 FIND_LIBRARY(Lua_LIBRARIES lua5.1 PATH
     21FIND_LIBRARY(Lua_LIBRARIES lua5.1
    3022        /usr/lib
    3123        /usr/local/lib)
    3224
     25ADD_DEFINITIONS(-DLUA_VERSION=51)
     26
     27IF (NOT Lua_LIBRARIES AND Lua_INCLUDE_DIR)
     28FIND_PATH(Lua_INCLUDE_DIR lua.h
     29        /usr/include/lua50
     30        /usr/local/include/lua50
     31        /usr/pack/lua-5.0.3-sd/include/)
     32
     33FIND_LIBRARY(Lua_LIBRARIES lua50
     34        /usr/lib
     35        /usr/local/lib
     36        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/)
     37
     38FIND_LIBRARY(Lua_LIBRARY lualib50
     39        /usr/lib
     40        /usr/local/lib
     41        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/)
     42
     43SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
     44ADD_DEFINITIONS(-DLUA_VERSION=50)
     45
     46ENDIF (NOT Lua_LIBRARIES AND Lua_INCLUDE_DIR)
    3347
    3448IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
  • code/branches/script/src/orxonox/script/Script.cc

    r946 r954  
    2727
    2828#include "Script.h"
    29 //#include <lua.h>
    30 #include <lualib.h>
    31 #include <lauxlib.h>
     29extern "C" {
     30#include "lualib.h"
     31#include "lauxlib.h"
     32}
    3233
    3334
     
    3738  {
    3839    state_ = lua_open();
    39 
     40#if Lua_VERSION == 51
    4041    luaL_openlibs(state_);
     42#else
     43    luaopen_base(state_);
     44    luaopen_table(state_);
     45    luaopen_io(state_);
     46    luaopen_string(state_);
     47    luaopen_math(state_);
     48    luaopen_debug(state_);
     49#endif
    4150  }
    4251
  • code/branches/script/src/orxonox/script/Script.h

    r946 r954  
    88#define _Script_H__
    99
    10 #include <lua.h>
     10extern "C" {
     11#include "lua.h"
     12}
    1113
    1214namespace orxonox
Note: See TracChangeset for help on using the changeset viewer.