diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8318843..e73c517 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,5 @@ +add_compile_definitions(UNF_EXPORTS) + add_library(unf unf/broker.cpp unf/capturePredicate.cpp diff --git a/src/unf/api.h b/src/unf/api.h index ff7db37..184a0c6 100644 --- a/src/unf/api.h +++ b/src/unf/api.h @@ -3,7 +3,22 @@ #include "pxr/base/arch/export.h" -#define UNF_API ARCH_EXPORT -#define UNF_LOCAL ARCH_HIDDEN +#if defined(UNF_STATIC) +# define UNF_API +# define UNF_API_TEMPLATE_CLASS(...) +# define UNF_API_TEMPLATE_STRUCT(...) +# define UNF_LOCAL +#else +# if defined(UNF_EXPORTS) +# define UNF_API ARCH_EXPORT +# define UNF_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__) +# define UNF_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__) +# else +# define UNF_API ARCH_IMPORT +# define UNF_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__) +# define UNF_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__) +# endif +# define UNF_LOCAL ARCH_HIDDEN +#endif #endif \ No newline at end of file diff --git a/src/unf/broker.h b/src/unf/broker.h index 172421a..dcdb750 100644 --- a/src/unf/broker.h +++ b/src/unf/broker.h @@ -131,7 +131,7 @@ class Broker : public PXR_NS::TfRefBase, public PXR_NS::TfWeakBase { /// \note /// The associated stage will be used as sender. template - UNF_API void Send(Args&&... args); + void Send(Args&&... args); /// \brief /// Send a UnfNotice::StageNotice notice via the broker. @@ -148,7 +148,7 @@ class Broker : public PXR_NS::TfRefBase, public PXR_NS::TfWeakBase { /// /// This will call the Dispatcher::Register method. template - UNF_API void AddDispatcher(); + void AddDispatcher(); /// \brief /// Un-register broker.