Skip to content

Commit 43de3e5

Browse files
Add SOVERSION for the C++ libraries (#1860)
* Add SOVERSION for the C++ libraries Co-authored-by: Nick Porcino <[email protected]> Signed-off-by: Darby Johnston <[email protected]>
1 parent 4d31e15 commit 43de3e5

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,31 @@ else()
119119
endif()
120120
endif()
121121

122+
# Set the SO version. The SO version must be incremented every time a change
123+
# occurs to the ABI that causes a backward incompatibility. Such changes
124+
# include, exhaustively:
125+
#
126+
# * a change to struct or class layout
127+
# * enum changes that would cause a renumbering of previously published enums
128+
# * a removal of a struct, class, enumeration, or function
129+
# * a change in parameters to a free standing function
130+
# * a removal of a global variable
131+
#
132+
# OTIO currently designates the minor version number for breaking changes,
133+
# e.g. v0.15, v0.16.0, v0.17.0, accordingly the SO version will be incremented
134+
# to match. SO version must be monotically increasing, so the ABI version
135+
# should be computed as: major * 100 + revision. The third digit will never
136+
# implicate an ABI version change. So for example, the following OTIO versions
137+
# would map to these ABI versions:
138+
#
139+
# * v0.18.0 - 18
140+
# * v0.19.0 - 19
141+
# * v0.19.1 - 19 # No ABI changes with minor version changes
142+
# * v1.0.0 - 100
143+
# * v1.1.0 - 101
144+
#
145+
math(EXPR OTIO_SOVERSION "${OTIO_VERSION_MAJOR} * 100 + ${OTIO_VERSION_MINOR}")
146+
122147
set(OTIO_RESOLVED_CXX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
123148

124149
if(OTIO_CXX_INSTALL)

src/opentime/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ set_target_properties(opentime PROPERTIES
2424
POSITION_INDEPENDENT_CODE TRUE
2525
WINDOWS_EXPORT_ALL_SYMBOLS true)
2626

27+
if(BUILD_SHARED_LIBS)
28+
set_target_properties(opentime PROPERTIES
29+
SOVERSION ${OTIO_SOVERSION}
30+
VERSION ${OTIO_VERSION})
31+
endif()
32+
2733
if(APPLE)
2834
set_target_properties(opentime PROPERTIES
2935
INSTALL_NAME_DIR "@loader_path"

src/opentimelineio/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ set_target_properties(opentimelineio PROPERTIES
9898
POSITION_INDEPENDENT_CODE TRUE
9999
WINDOWS_EXPORT_ALL_SYMBOLS true)
100100

101+
if(BUILD_SHARED_LIBS)
102+
set_target_properties(opentimelineio PROPERTIES
103+
SOVERSION ${OTIO_SOVERSION}
104+
VERSION ${OTIO_VERSION})
105+
endif()
106+
101107
if(APPLE)
102108
set_target_properties(opentimelineio PROPERTIES
103109
INSTALL_NAME_DIR "@loader_path"

0 commit comments

Comments
 (0)