Switched PoyVox to build as a static library.

This commit is contained in:
David Williams
2011-04-20 23:25:32 +01:00
parent a5f37d7a3a
commit ef52b906e6
21 changed files with 71 additions and 86 deletions

View File

@ -28,8 +28,8 @@ freely, subject to the following restrictions:
namespace PolyVox
{
extern POLYVOXCORE_API int edgeTable[256];
extern POLYVOXCORE_API int triTable[256][16];
extern POLYVOX_API int edgeTable[256];
extern POLYVOX_API int triTable[256][16];
}
#endif

View File

@ -28,7 +28,7 @@ freely, subject to the following restrictions:
namespace PolyVox
{
extern POLYVOXCORE_API const Vector3DFloat randomUnitVectors[];
extern POLYVOX_API const Vector3DFloat randomUnitVectors[];
}
#endif //__PolyVox_RandomUnitVectors_H__

View File

@ -28,7 +28,7 @@ freely, subject to the following restrictions:
namespace PolyVox
{
extern POLYVOXCORE_API const Vector3DFloat randomVectors[];
extern POLYVOX_API const Vector3DFloat randomVectors[];
}
#endif //__PolyVox_RandomVectors_H__

View File

@ -25,18 +25,39 @@ freely, subject to the following restrictions:
#define __PolyVox_TypeDef_H__
//Definitions needed to make library functions accessable
#ifdef _MSC_VER
//We are using a Microsoft compiler.
#ifdef POLYVOXCORE_EXPORT
#define POLYVOXCORE_API __declspec(dllexport)
#else
#define POLYVOXCORE_API __declspec(dllimport)
#endif
// See http://gcc.gnu.org/wiki/Visibility for more info.
#if defined _WIN32 || defined __CYGWIN__
#define POLYVOX_HELPER_IMPORT __declspec(dllimport)
#define POLYVOX_HELPER_EXPORT __declspec(dllexport)
#define POLYVOX_HELPER_LOCAL
#else
//Assume a GNU compiler.
#define POLYVOXCORE_API __attribute__ ((visibility("default")))
#if __GNUC__ >= 4
#define POLYVOX_HELPER_IMPORT __attribute__ ((visibility("default")))
#define POLYVOX_HELPER_EXPORT __attribute__ ((visibility("default")))
#define POLYVOX_HELPER_LOCAL __attribute__ ((visibility("hidden")))
#else
#define POLYVOX_HELPER_IMPORT
#define POLYVOX_HELPER_EXPORT
#define POLYVOX_HELPER_LOCAL
#endif
#endif
// Now we use the generic helper definitions above to define POLYVOX_API and POLYVOX_LOCAL.
// POLYVOX_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
// POLYVOX_LOCAL is used for non-api symbols.
#ifdef POLYVOX_SHARED // defined if FOX is compiled as a DLL
#ifdef POLYVOX_SHARED_EXPORTS // defined if we are building the FOX DLL (instead of using it)
#define POLYVOX_API POLYVOX_HELPER_EXPORT
#else
#define POLYVOX_API POLYVOX_HELPER_IMPORT
#endif // POLYVOX_SHARED_EXPORTS
#define POLYVOX_LOCAL POLYVOX_HELPER_LOCAL
#else // POLYVOX_SHARED is not defined: this means FOX is a static lib.
#define POLYVOX_API
#define POLYVOX_LOCAL
#endif // POLYVOX_SHARED
//Check which compiler we are using and work around unsupported features as necessary.
#if defined(_MSC_VER) && (_MSC_VER < 1600)
//To support old (pre-vc2010) Microsoft compilers we use boost to replace the

View File

@ -30,8 +30,8 @@ freely, subject to the following restrictions:
namespace PolyVox
{
POLYVOXCORE_API uint8_t logBase2(uint32_t uInput);
POLYVOXCORE_API bool isPowerOf2(uint32_t uInput);
POLYVOX_API uint8_t logBase2(uint32_t uInput);
POLYVOX_API bool isPowerOf2(uint32_t uInput);
template <typename Type>
Type trilinearlyInterpolate(