Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ option(OTIO_FIND_RAPIDJSON "Find RapidJSON using find_package" OFF)
set(OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)")

# Build options
#
# If you are building OpenTimelineIO as a static library you will need to
# defined OPENTIME_STATIC and OTIO_STATIC. If you use the provided CMake
# config files these will be automatically defined for you. To use the
# provided config files add `find_package(OpenTimelineIO)` to your
# CMakeLists.txt file.
#
option(OTIO_SHARED_LIBS "Build shared if ON, static if OFF" ON)
option(OTIO_CXX_COVERAGE "Invoke code coverage if lcov/gcov is available" OFF)
option(OTIO_CXX_EXAMPLES "Build CXX examples (also requires OTIO_PYTHON_INSTALL=ON)" OFF)
Expand Down
2 changes: 1 addition & 1 deletion src/opentime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set_target_properties(opentime PROPERTIES
LIBRARY_OUTPUT_NAME "opentime"
POSITION_INDEPENDENT_CODE TRUE)

if(BUILD_SHARED_LIBS)
if(OTIO_SHARED_LIBS)
set_target_properties(opentime PROPERTIES
SOVERSION ${OTIO_SOVERSION}
VERSION ${OTIO_VERSION})
Expand Down
62 changes: 33 additions & 29 deletions src/opentime/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,38 @@
// https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/base/arch/export.h
#if defined(_WINDOWS)
# if defined(__GNUC__) && __GNUC__ >= 4 || defined(__clang__)
# define OPENTIMELINIO_EXPORT __attribute__((dllexport))
# define OPENTIMELINIO_IMPORT __attribute__((dllimport))
# define OPENTIMELINIO_HIDDEN
# define OPENTIMELINIO_EXPORT_TYPE
# define OPENTIMELINEIO_EXPORT __attribute__((dllexport))
# define OPENTIMELINEIO_IMPORT __attribute__((dllimport))
# define OPENTIMELINEIO_HIDDEN
# define OPENTIMELINEIO_EXPORT_TYPE
# define OPENTIMELINEIO_IMPORT_TYPE
# else
# define OPENTIMELINIO_EXPORT __declspec(dllexport)
# define OPENTIMELINIO_IMPORT __declspec(dllimport)
# define OPENTIMELINIO_HIDDEN
# define OPENTIMELINIO_EXPORT_TYPE
# define OPENTIMELINEIO_EXPORT __declspec(dllexport)
# define OPENTIMELINEIO_IMPORT __declspec(dllimport)
# define OPENTIMELINEIO_HIDDEN
# define OPENTIMELINEIO_EXPORT_TYPE
# define OPENTIMELINEIO_IMPORT_TYPE
# endif
#elif defined(__GNUC__) && __GNUC__ >= 4 || defined(__clang__)
# define OPENTIMELINIO_EXPORT __attribute__((visibility("default")))
# define OPENTIMELINIO_IMPORT
# define OPENTIMELINIO_HIDDEN __attribute__((visibility("hidden")))
# define OPENTIMELINEIO_EXPORT __attribute__((visibility("default")))
# define OPENTIMELINEIO_IMPORT
# define OPENTIMELINEIO_HIDDEN __attribute__((visibility("hidden")))
# if defined(__clang__)
# define OPENTIMELINIO_EXPORT_TYPE __attribute__((type_visibility("default")))
# define OPENTIMELINEIO_EXPORT_TYPE __attribute__((type_visibility("default")))
# else
# define OPENTIMELINIO_EXPORT_TYPE __attribute__((visibility("default")))
# define OPENTIMELINEIO_EXPORT_TYPE __attribute__((visibility("default")))
# endif
# define OPENTIMELINEIO_IMPORT_TYPE
#else
# define OPENTIMELINIO_EXPORT
# define OPENTIMELINIO_IMPORT
# define OPENTIMELINIO_HIDDEN
# define OPENTIMELINIO_EXPORT_TYPE
# define OPENTIMELINEIO_EXPORT
# define OPENTIMELINEIO_IMPORT
# define OPENTIMELINEIO_HIDDEN
# define OPENTIMELINEIO_EXPORT_TYPE
# define OPENTIMELINEIO_IMPORT_TYPE
#endif
#define OPENTIMELINIO_EXPORT_TEMPLATE(type, ...)
#define OPENTIMELINIO_IMPORT_TEMPLATE(type, ...) \
extern template type OPENTIMELINIO_IMPORT __VA_ARGS__
#define OPENTIMELINEIO_EXPORT_TEMPLATE(type, ...)
#define OPENTIMELINEIO_IMPORT_TEMPLATE(type, ...) \
extern template type OPENTIMELINEIO_IMPORT __VA_ARGS__

#if defined(OPENTIME_STATIC)
# define OPENTIME_API
Expand All @@ -44,19 +48,19 @@
# define OPENTIME_LOCAL
#else
# if defined(OPENTIME_EXPORTS)
# define OPENTIME_API OPENTIMELINIO_EXPORT
# define OPENTIME_API_TYPE OPENTIMELINIO_EXPORT_TYPE
# define OPENTIME_API OPENTIMELINEIO_EXPORT
# define OPENTIME_API_TYPE OPENTIMELINEIO_EXPORT_TYPE
# define OPENTIME_API_TEMPLATE_CLASS(...) \
OPENTIMELINIO_EXPORT_TEMPLATE(class, __VA_ARGS__)
OPENTIMELINEIO_EXPORT_TEMPLATE(class, __VA_ARGS__)
# define OPENTIME_API_TEMPLATE_STRUCT(...) \
OPENTIMELINIO_EXPORT_TEMPLATE(struct, __VA_ARGS__)
OPENTIMELINEIO_EXPORT_TEMPLATE(struct, __VA_ARGS__)
# else
# define OPENTIME_API OPENTIMELINIO_IMPORT
# define OPENTIME_API_TYPE OPENTIMELINIO_IMPORT_TYPE
# define OPENTIME_API OPENTIMELINEIO_IMPORT
# define OPENTIME_API_TYPE OPENTIMELINEIO_IMPORT_TYPE
# define OPENTIME_API_TEMPLATE_CLASS(...) \
OPENTIMELINIO_IMPORT_TEMPLATE(class, __VA_ARGS__)
OPENTIMELINEIO_IMPORT_TEMPLATE(class, __VA_ARGS__)
# define OPENTIME_API_TEMPLATE_STRUCT(...) \
OPENTIMELINIO_IMPORT_TEMPLATE(struct, __VA_ARGS__)
OPENTIMELINEIO_IMPORT_TEMPLATE(struct, __VA_ARGS__)
# endif
# define OPENTIME_LOCAL OPENTIMELINIO_HIDDEN
# define OPENTIME_LOCAL OPENTIMELINEIO_HIDDEN
#endif
2 changes: 1 addition & 1 deletion src/opentimelineio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ set_target_properties(opentimelineio PROPERTIES
LIBRARY_OUTPUT_NAME "opentimelineio"
POSITION_INDEPENDENT_CODE TRUE)

if(BUILD_SHARED_LIBS)
if(OTIO_SHARED_LIBS)
set_target_properties(opentimelineio PROPERTIES
SOVERSION ${OTIO_SOVERSION}
VERSION ${OTIO_VERSION})
Expand Down
18 changes: 9 additions & 9 deletions src/opentimelineio/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
# define OTIO_LOCAL
#else
# if defined(OTIO_EXPORTS)
# define OTIO_API OPENTIMELINIO_EXPORT
# define OTIO_API_TYPE OPENTIMELINIO_EXPORT_TYPE
# define OTIO_API OPENTIMELINEIO_EXPORT
# define OTIO_API_TYPE OPENTIMELINEIO_EXPORT_TYPE
# define OTIO_API_TEMPLATE_CLASS(...) \
OPENTIMELINIO_EXPORT_TEMPLATE(class, __VA_ARGS__)
OPENTIMELINEIO_EXPORT_TEMPLATE(class, __VA_ARGS__)
# define OTIO_API_TEMPLATE_STRUCT(...) \
OPENTIMELINIO_EXPORT_TEMPLATE(struct, __VA_ARGS__)
OPENTIMELINEIO_EXPORT_TEMPLATE(struct, __VA_ARGS__)
# else
# define OTIO_API OPENTIMELINIO_IMPORT
# define OTIO_API_TYPE OPENTIMELINIO_IMPORT_TYPE
# define OTIO_API OPENTIMELINEIO_IMPORT
# define OTIO_API_TYPE OPENTIMELINEIO_IMPORT_TYPE
# define OTIO_API_TEMPLATE_CLASS(...) \
OPENTIMELINIO_IMPORT_TEMPLATE(class, __VA_ARGS__)
OPENTIMELINEIO_IMPORT_TEMPLATE(class, __VA_ARGS__)
# define OTIO_API_TEMPLATE_STRUCT(...) \
OPENTIMELINIO_IMPORT_TEMPLATE(struct, __VA_ARGS__)
OPENTIMELINEIO_IMPORT_TEMPLATE(struct, __VA_ARGS__)
# endif
# define OTIO_LOCAL OPENTIMELINIO_HIDDEN
# define OTIO_LOCAL OPENTIMELINEIO_HIDDEN
#endif
Loading