mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-26 10:30:54 +00:00
Fixed: Compilation with luabind 0.7 (include luabind/version.hpp only when existing)
This commit is contained in:
parent
7586b64494
commit
18785f0fbd
3 changed files with 28 additions and 18 deletions
|
@ -74,6 +74,12 @@ IF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR)
|
||||||
ENDIF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR)
|
ENDIF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR)
|
||||||
|
|
||||||
IF(LUABIND_FOUND)
|
IF(LUABIND_FOUND)
|
||||||
|
# Check if luabind/version.hpp exists
|
||||||
|
FIND_FILE(LUABIND_VERSION_FILE luabind/version.hpp PATHS ${LUABIND_INCLUDE_DIR})
|
||||||
|
IF(LUABIND_VERSION_FILE)
|
||||||
|
SET(HAVE_LUABIND_VERSION 1 CACHE INTERNAL "Luabind provides a version.hpp file")
|
||||||
|
SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION")
|
||||||
|
ENDIF(LUABIND_VERSION_FILE)
|
||||||
IF(NOT LUABIND_FIND_QUIETLY)
|
IF(NOT LUABIND_FIND_QUIETLY)
|
||||||
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}")
|
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}")
|
||||||
ENDIF(NOT LUABIND_FIND_QUIETLY)
|
ENDIF(NOT LUABIND_FIND_QUIETLY)
|
||||||
|
|
|
@ -102,7 +102,7 @@ IF(APPLE)
|
||||||
TARGET_LINK_LIBRARIES(ryzom_client ${FOUNDATION_LIBRARY})
|
TARGET_LINK_LIBRARIES(ryzom_client ${FOUNDATION_LIBRARY})
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS})
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS} ${LUABIND_DEFINITIONS})
|
||||||
|
|
||||||
NL_DEFAULT_PROPS(ryzom_client "Ryzom, Client: Ryzom Core Client")
|
NL_DEFAULT_PROPS(ryzom_client "Ryzom, Client: Ryzom Core Client")
|
||||||
NL_ADD_RUNTIME_FLAGS(ryzom_client)
|
NL_ADD_RUNTIME_FLAGS(ryzom_client)
|
||||||
|
|
|
@ -16,15 +16,9 @@
|
||||||
|
|
||||||
|
|
||||||
#include "stdpch.h"
|
#include "stdpch.h"
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "lua_helper.h"
|
#include "lua_helper.h"
|
||||||
// Warning: cannot use namespace std, when using luabind
|
|
||||||
#ifdef NL_OS_WINDOWS
|
#include <algorithm>
|
||||||
# ifndef NL_EXTENDED_FOR_SCOPE
|
|
||||||
# undef for
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// to get rid of you_must_not_use_assert___use_nl_assert___read_debug_h_file messages
|
// to get rid of you_must_not_use_assert___use_nl_assert___read_debug_h_file messages
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -32,26 +26,36 @@
|
||||||
#undef assert
|
#undef assert
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Warning: cannot use namespace std, when using luabind
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
|
# ifndef NL_EXTENDED_FOR_SCOPE
|
||||||
|
# undef for
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NL_DEBUG
|
#ifdef NL_DEBUG
|
||||||
#define assert(x) nlassert(x)
|
# define assert(x) nlassert(x)
|
||||||
#else
|
#else
|
||||||
#define assert(x)
|
# define assert(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <luabind/luabind.hpp>
|
#include <luabind/luabind.hpp>
|
||||||
// in luabind > 0.6, LUABIND_MAX_ARITY is set to 10
|
// in luabind > 0.6, LUABIND_MAX_ARITY is set to 10
|
||||||
#if LUABIND_MAX_ARITY == 10
|
#if LUABIND_MAX_ARITY == 10
|
||||||
# include <luabind/operator.hpp>
|
# include <luabind/operator.hpp>
|
||||||
# include <luabind/version.hpp>
|
// only luabind > 0.7 have version.hpp (file checked with build system)
|
||||||
# ifndef LUABIND_VERSION
|
# ifdef HAVE_LUABIND_VERSION
|
||||||
|
# include <luabind/version.hpp>
|
||||||
|
# endif
|
||||||
|
# ifndef LUABIND_VERSION
|
||||||
// luabind 0.7 doesn't define LUABIND_VERSION
|
// luabind 0.7 doesn't define LUABIND_VERSION
|
||||||
# define LUABIND_VERSION 700
|
# define LUABIND_VERSION 700
|
||||||
# endif
|
# endif
|
||||||
// luabind 0.6 doesn't define LUABIND_VERSION but LUABIND_MAX_ARITY is set to 5
|
// luabind 0.6 doesn't define LUABIND_VERSION but LUABIND_MAX_ARITY is set to 5
|
||||||
#elif LUABIND_MAX_ARITY == 5
|
#elif LUABIND_MAX_ARITY == 5
|
||||||
# define LUABIND_VERSION 600
|
# define LUABIND_VERSION 600
|
||||||
#else
|
#else
|
||||||
# pragma error("luabind version not recognized")
|
# pragma error("luabind version not recognized")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue