Skip to content

Commit f2e1f83

Browse files
committed
Export C++ symbols
Signed-off-by: Darby Johnston <[email protected]>
1 parent 639f57c commit f2e1f83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+116
-99
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ endif()
192192

193193
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
194194

195+
include(GenerateExportHeader)
196+
195197
#------------------------------------------------------------------------------
196198
# Fetch or refresh submodules if requested
197199
#

src/opentime/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ target_include_directories(
2525
set_target_properties(opentime PROPERTIES
2626
DEBUG_POSTFIX "${OTIO_DEBUG_POSTFIX}"
2727
LIBRARY_OUTPUT_NAME "opentime"
28-
POSITION_INDEPENDENT_CODE TRUE
29-
WINDOWS_EXPORT_ALL_SYMBOLS true)
28+
POSITION_INDEPENDENT_CODE TRUE)
3029

3130
if(BUILD_SHARED_LIBS)
3231
set_target_properties(opentime PROPERTIES
@@ -52,6 +51,10 @@ configure_file(
5251
${CMAKE_CURRENT_BINARY_DIR}/version.h
5352
)
5453

54+
generate_export_header(
55+
opentime
56+
EXPORT_FILE_NAME export.h)
57+
5558
if(OTIO_CXX_INSTALL)
5659
install(FILES ${OPENTIME_HEADER_FILES}
5760
DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/include/opentime")
@@ -86,6 +89,7 @@ if(OTIO_CXX_INSTALL)
8689

8790
install(
8891
FILES
92+
${CMAKE_CURRENT_BINARY_DIR}/export.h
8993
${CMAKE_CURRENT_BINARY_DIR}/version.h
9094
DESTINATION
9195
"${OTIO_RESOLVED_CXX_INSTALL_DIR}/include/opentime"

src/opentime/errorStatus.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33

44
#pragma once
55

6+
#include "opentime/export.h"
67
#include "opentime/version.h"
78
#include <string>
89

910
namespace opentime { namespace OPENTIME_VERSION {
1011

1112
/// @brief This struct represents the return status of a function.
12-
struct ErrorStatus
13+
struct OPENTIME_EXPORT ErrorStatus
1314
{
1415
/// @brief This enumeration represents the possible outcomes.
1516
enum Outcome
@@ -51,14 +52,14 @@ struct ErrorStatus
5152
};
5253

5354
///! @brief Check whether the given ErrorStatus is an error.
54-
constexpr bool
55+
OPENTIME_EXPORT constexpr bool
5556
is_error(const ErrorStatus& es) noexcept
5657
{
5758
return ErrorStatus::Outcome::OK != es.outcome;
5859
}
5960

6061
///! @brief Check whether the given ErrorStatus is non-null and an error.
61-
constexpr bool
62+
OPENTIME_EXPORT constexpr bool
6263
is_error(const ErrorStatus* es) noexcept
6364
{
6465
return es && ErrorStatus::Outcome::OK != es->outcome;

src/opentime/rationalTime.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace opentime { namespace OPENTIME_VERSION {
1414

1515
/// @brief This enumeration provides options for drop frame timecode.
16-
enum IsDropFrameRate : int
16+
enum OPENTIME_EXPORT IsDropFrameRate : int
1717
{
1818
InferFromRate = -1,
1919
ForceNo = 0,
@@ -23,7 +23,7 @@ enum IsDropFrameRate : int
2323
/// @brief Returns the absolute value.
2424
///
2525
/// \todo Document why this function is used instead of "std::fabs()".
26-
constexpr double
26+
OPENTIME_EXPORT constexpr double
2727
fabs(double val) noexcept
2828
{
2929
union
@@ -36,7 +36,7 @@ fabs(double val) noexcept
3636
}
3737

3838
/// @brief This class represents a measure of time defined by a value and rate.
39-
class RationalTime
39+
class OPENTIME_EXPORT RationalTime
4040
{
4141
public:
4242
/// @brief Construct a new time with an optional value and rate.

src/opentime/timeRange.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace opentime { namespace OPENTIME_VERSION {
1616
/// a resolution of half a frame at 192kHz. The value can be changed in the future if
1717
/// necessary, due to higher sampling rates or some other kind of numeric tolerance
1818
/// detected in the library.
19-
constexpr double DEFAULT_EPSILON_s = 1.0 / (2 * 192000.0);
19+
OPENTIME_EXPORT constexpr double DEFAULT_EPSILON_s = 1.0 / (2 * 192000.0);
2020

2121
/// @brief This class represents a time range defined by a start time and duration.
2222
///
@@ -27,7 +27,7 @@ constexpr double DEFAULT_EPSILON_s = 1.0 / (2 * 192000.0);
2727
/// The duration on a TimeRange indicates a time range that is inclusive of the
2828
/// start time, and exclusive of the end time. All of the predicates are
2929
/// computed accordingly.
30-
class TimeRange
30+
class OPENTIME_EXPORT TimeRange
3131
{
3232
public:
3333
/// @brief Construct a new time range with a zero start time and duration.

src/opentime/timeTransform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace opentime { namespace OPENTIME_VERSION {
1212

1313
/// @brief One-dimensional time transform.
14-
class TimeTransform
14+
class OPENTIME_EXPORT TimeTransform
1515
{
1616
public:
1717
/// @brief Construct a new transform with an optional offset, scale, and rate.

src/opentimelineio/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ target_link_libraries(opentimelineio
100100
set_target_properties(opentimelineio PROPERTIES
101101
DEBUG_POSTFIX "${OTIO_DEBUG_POSTFIX}"
102102
LIBRARY_OUTPUT_NAME "opentimelineio"
103-
POSITION_INDEPENDENT_CODE TRUE
104-
WINDOWS_EXPORT_ALL_SYMBOLS true)
103+
POSITION_INDEPENDENT_CODE TRUE)
105104

106105
if(BUILD_SHARED_LIBS)
107106
set_target_properties(opentimelineio PROPERTIES
@@ -128,6 +127,10 @@ configure_file(
128127
${CMAKE_CURRENT_BINARY_DIR}/version.h
129128
)
130129

130+
generate_export_header(
131+
opentimelineio
132+
EXPORT_FILE_NAME export.h)
133+
131134
if(OTIO_CXX_INSTALL)
132135
install(FILES ${OPENTIMELINEIO_HEADER_FILES}
133136
DESTINATION "${OTIO_RESOLVED_CXX_INSTALL_DIR}/include/opentimelineio")
@@ -164,6 +167,7 @@ if(OTIO_CXX_INSTALL)
164167

165168
install(
166169
FILES
170+
${CMAKE_CURRENT_BINARY_DIR}/export.h
167171
${CMAKE_CURRENT_BINARY_DIR}/version.h
168172
DESTINATION
169173
"${OTIO_RESOLVED_CXX_INSTALL_DIR}/include/opentimelineio"

src/opentimelineio/algo/editAlgorithm.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { namespace algo {
99

1010
//! Enum used by 3/4 Point Edit (aka. as fill)
11-
enum class ReferencePoint
11+
enum class OPENTIMELINEIO_EXPORT ReferencePoint
1212
{
1313
Source,
1414
Sequence,
@@ -38,7 +38,7 @@ enum class ReferencePoint
3838
//
3939
// If overwrite range starts and ends before A, a gap hole is filled with
4040
// fill_template.
41-
void overwrite(
41+
OPENTIMELINEIO_EXPORT void overwrite(
4242
Item* item,
4343
Composition* composition,
4444
TimeRange const& range,
@@ -62,7 +62,7 @@ void overwrite(
6262
// If A and B's length is L1 and C's length is L2, the end result is L1 + L2.
6363
// A is split.
6464
//
65-
void insert(
65+
OPENTIMELINEIO_EXPORT void insert(
6666
Item* const item,
6767
Composition* composition,
6868
RationalTime const& time,
@@ -88,7 +88,7 @@ void insert(
8888
// Fill now-"empty" time with gap or template
8989
// Unless item is meeting a Gap, then, existing Gap's duration will be augmented
9090
//
91-
void trim(
91+
OPENTIMELINEIO_EXPORT void trim(
9292
Item* item,
9393
RationalTime const& delta_in,
9494
RationalTime const& delta_out,
@@ -101,7 +101,7 @@ void trim(
101101
// ^
102102
// composition = usually a track item.
103103
// time = time to slice at.
104-
void slice(
104+
OPENTIMELINEIO_EXPORT void slice(
105105
Composition* composition,
106106
RationalTime const& time,
107107
bool const remove_transitions = true,
@@ -119,7 +119,7 @@ void slice(
119119
// Do not affect item duration.
120120
// Do not affect surrounding items.
121121
// Clamp to available_range of media (if available)
122-
void slip(Item* item, RationalTime const& delta);
122+
OPENTIMELINEIO_EXPORT void slip(Item* item, RationalTime const& delta);
123123

124124
//
125125
// Slide an item start_time by + or -, adjusting the previous item's duration.
@@ -133,7 +133,7 @@ void slip(Item* item, RationalTime const& delta);
133133
//
134134
// If item is the first clip, it does nothing.
135135
//
136-
void slide(Item* item, RationalTime const& delta);
136+
OPENTIMELINEIO_EXPORT void slide(Item* item, RationalTime const& delta);
137137

138138
//
139139
// Adjust a source_range without affecting any other items.
@@ -146,7 +146,7 @@ void slide(Item* item, RationalTime const& delta);
146146
// will be adjusted by
147147
// delta_out = RationalTime that the item's
148148
// source_range().end_time_exclusive() will be adjusted by
149-
void ripple(
149+
OPENTIMELINEIO_EXPORT void ripple(
150150
Item* item,
151151
RationalTime const& delta_in,
152152
RationalTime const& delta_out,
@@ -168,7 +168,7 @@ void ripple(
168168
// will be adjusted by
169169
// delta_out = RationalTime that the item's
170170
// source_range().end_time_exclusive() will be adjusted by
171-
void roll(
171+
OPENTIMELINEIO_EXPORT void roll(
172172
Item* item,
173173
RationalTime const& delta_in,
174174
RationalTime const& delta_out,
@@ -186,7 +186,7 @@ void roll(
186186
// reference_point = For 4 point editing, the reference point dictates what
187187
// transform to use when running the fill.
188188
//
189-
void fill(
189+
OPENTIMELINEIO_EXPORT void fill(
190190
Item* item,
191191
Composition* track,
192192
RationalTime const& track_time,
@@ -207,7 +207,7 @@ void fill(
207207
//
208208
// if fill is not set, A and B become concatenated, with no fill.
209209
//
210-
void remove(
210+
OPENTIMELINEIO_EXPORT void remove(
211211
Composition* composition,
212212
RationalTime const& time,
213213
bool const fill = true,

src/opentimelineio/anyDictionary.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#pragma once
55

6+
#include "opentimelineio/export.h"
67
#include "opentimelineio/version.h"
78

89
#include <any>
@@ -24,7 +25,7 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
2425
/// This allows us to hand out iterators that can be aware of mutation and moves
2526
/// and take steps to safe-guard themselves from causing a crash. (Yes, I'm
2627
/// talking to you, Python...)
27-
class AnyDictionary : private std::map<std::string, std::any>
28+
class OPENTIMELINEIO_EXPORT AnyDictionary : private std::map<std::string, std::any>
2829
{
2930
public:
3031
using map::map;

src/opentimelineio/anyVector.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#pragma once
55

6+
#include "opentimelineio/export.h"
67
#include "opentimelineio/version.h"
78

89
#include <any>
@@ -20,7 +21,7 @@ namespace opentimelineio { namespace OPENTIMELINEIO_VERSION {
2021
///
2122
/// This allows us to hand out iterators that can be aware of moves
2223
/// and take steps to safe-guard themselves from causing a crash.
23-
class AnyVector : private std::vector<std::any>
24+
class OPENTIMELINEIO_EXPORT AnyVector : private std::vector<std::any>
2425
{
2526
public:
2627
using vector::vector;

0 commit comments

Comments
 (0)