liblua visibility and compiler-flags
This commit is contained in:
@@ -1,16 +1,35 @@
|
||||
/* This is a C++ wrapper to compile the lua C code
|
||||
* with settings appropriate for including it with
|
||||
* Ardour.
|
||||
*/
|
||||
|
||||
#include "lua/liblua_visibility.h"
|
||||
|
||||
#if _MSC_VER
|
||||
#pragma push_macro("_CRT_SECURE_NO_WARNINGS")
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
# pragma push_macro("_CRT_SECURE_NO_WARNINGS")
|
||||
# ifndef _CRT_SECURE_NO_WARNINGS
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
# endif
|
||||
#elif defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wcast-qual"
|
||||
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
#endif
|
||||
|
||||
// forward ardour's defines to luaconf.h
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
# define LUA_USE_WINDOWS
|
||||
# define LUA_USE_WINDOWS
|
||||
#elif defined __APPLE__
|
||||
# define LUA_USE_MACOSX
|
||||
# define LUA_USE_MACOSX
|
||||
#else
|
||||
# define LUA_USE_LINUX
|
||||
# define LUA_USE_LINUX
|
||||
#endif
|
||||
|
||||
// forward liblua visibility to luaconf.h
|
||||
#ifdef LIBLUA_BUILD_AS_DLL
|
||||
#define LUA_BUILD_AS_DLL
|
||||
#endif
|
||||
|
||||
extern "C"
|
||||
@@ -27,12 +46,14 @@ extern "C"
|
||||
#undef LUA_LIB
|
||||
|
||||
// override luaconf.h symbol export
|
||||
#undef LUA_API
|
||||
#undef LUALIB_API
|
||||
#undef LUAMOD_API
|
||||
#define LUA_API extern "C"
|
||||
#define LUALIB_API LUA_API
|
||||
#define LUAMOD_API LUALIB_API
|
||||
#ifdef LIBLUA_STATIC // static lib (no DLL)
|
||||
# undef LUA_API
|
||||
# undef LUALIB_API
|
||||
# undef LUAMOD_API
|
||||
# define LUA_API extern "C"
|
||||
# define LUALIB_API LUA_API
|
||||
# define LUAMOD_API LUALIB_API
|
||||
#endif
|
||||
|
||||
// disable support for extenal libs
|
||||
#undef LUA_DL_DLL
|
||||
@@ -89,8 +110,12 @@ extern "C"
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
}
|
||||
} // end extern "C"
|
||||
|
||||
#if _MSC_VER
|
||||
#pragma pop_macro("_CRT_SECURE_NO_WARNINGS")
|
||||
# pragma pop_macro("_CRT_SECURE_NO_WARNINGS")
|
||||
#elif defined(__clang__)
|
||||
# pragma clang diagnostic pop
|
||||
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user