diff options
author | Naios <naios-dev@live.de> | 2016-03-20 00:50:21 +0100 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2016-03-24 01:28:55 +0100 |
commit | f4e0945b13a70225684e7421d9542efae6a47c89 (patch) | |
tree | fe974b35c5bd7f10be660c6b776db07d7998a9c0 /src/common/Define.h | |
parent | 3d32fd6ce08e99bdb56d258edbeb8590c481f815 (diff) |
Core/Build: Add the possibility to link libraries dynamically.
* makes it possible to access exported singletons from other shared lib's.
* reduces binary size
Diffstat (limited to 'src/common/Define.h')
-rw-r--r-- | src/common/Define.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/common/Define.h b/src/common/Define.h index 061a6bc2f5e..07b79252074 100644 --- a/src/common/Define.h +++ b/src/common/Define.h @@ -95,6 +95,45 @@ #endif #endif //COMPILER == COMPILER_GNU +#ifdef TRINITY_API_USE_DYNAMIC_LINKING +# if COMPILER == COMPILER_MICROSOFT +# define TC_API_EXPORT __declspec(dllexport) +# define TC_API_IMPORT __declspec(dllimport) +# elif COMPILER == COMPILER_GNU +# define TC_API_EXPORT __attribute__((visibility("default"))) +# define TC_API_IMPORT +# else +# error compiler not supported! +# endif +#else +# define TC_API_EXPORT +# define TC_API_IMPORT +#endif + +#ifdef TRINITY_API_EXPORT_COMMON +# define TC_COMMON_API TC_API_EXPORT +#else +# define TC_COMMON_API TC_API_IMPORT +#endif + +#ifdef TRINITY_API_EXPORT_DATABASE +# define TC_DATABASE_API TC_API_EXPORT +#else +# define TC_DATABASE_API TC_API_IMPORT +#endif + +#ifdef TRINITY_API_EXPORT_SHARED +# define TC_SHARED_API TC_API_EXPORT +#else +# define TC_SHARED_API TC_API_IMPORT +#endif + +#ifdef TRINITY_API_EXPORT_GAME +# define TC_GAME_API TC_API_EXPORT +#else +# define TC_GAME_API TC_API_IMPORT +#endif + #define UI64FMTD "%" PRIu64 #define UI64LIT(N) UINT64_C(N) |