Skip to content

Conversation

darbyjohnston
Copy link
Contributor

Fixes #1919

This change uses the CMake GenerateExportHeader functionality to explicitly export C++ symbols. In addition to fixing #1919, this can also potentially make the use of OTIO shared libraries more efficient.

Signed-off-by: Darby Johnston <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.00%. Comparing base (c0e97b0) to head (ca0c980).
⚠️ Report is 65 commits behind head on main.

❌ Your changes status has failed because you have indirect coverage changes. Learn more about Unexpected Coverage Changes and reasons for indirect coverage changes.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1920      +/-   ##
==========================================
+ Coverage   84.11%   85.00%   +0.88%     
==========================================
  Files         198      181      -17     
  Lines       22241    13074    -9167     
  Branches     4687     1206    -3481     
==========================================
- Hits        18709    11113    -7596     
+ Misses       2610     1778     -832     
+ Partials      922      183     -739     
Flag Coverage Δ
py-unittests 85.00% <100.00%> (+0.88%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/opentime/errorStatus.h 100.00% <ø> (ø)
src/opentime/rationalTime.h 95.83% <100.00%> (+1.15%) ⬆️
src/opentime/timeRange.h 98.36% <100.00%> (-0.74%) ⬇️
src/opentime/timeTransform.h 100.00% <ø> (+8.33%) ⬆️
src/opentimelineio/anyDictionary.h 96.92% <ø> (+5.39%) ⬆️
src/opentimelineio/anyVector.h 91.42% <ø> (+7.55%) ⬆️
src/opentimelineio/color.h 41.66% <ø> (ø)
src/opentimelineio/composable.h 100.00% <ø> (ø)
src/opentimelineio/composition.h 83.87% <ø> (+18.35%) ⬆️
src/opentimelineio/effect.h 83.33% <ø> (-16.67%) ⬇️
... and 16 more

... and 115 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b9d292...ca0c980. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jlskuz
Copy link
Contributor

jlskuz commented Aug 14, 2025

LGTM.

I wonder if [CMAKE_]CXX_VISIBILITY_PRESET should be set to hidden now so that everything that is not explicitly marked as exported will be hidden.

Copy link
Collaborator

@ssteinbach ssteinbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of questions! Thanks for putting this together though. Did you check to see if the DSO sizes or load times change at all after this?

@darbyjohnston
Copy link
Contributor Author

Did you check to see if the DSO sizes or load times change at all after this?

I checked and the sizes were the same, but I exported all of the symbols so I didn't expect any difference. Hopefully it's a feature we can take more advantage of in the future, for example the C++ OTIOZ PR has some code that might not need to be part of the public API.

darbyjohnston and others added 4 commits August 15, 2025 10:21
Co-authored-by: Stephan Steinbach <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Signed-off-by: Darby Johnston <[email protected]>
Copy link
Collaborator

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Darby can you please separate the fabs from the GenerateExportHeader functionality? the fabs diff is easy to land, introducing a new meta-source generator needs some discussion. I'm not aware of any projects that use this facility, and I'd like to understand why that is.

@jlskuz
Copy link
Contributor

jlskuz commented Aug 22, 2025

#1919 describes in detail why this is needed. It's a problem we are facing with Kdenlive on clang based builds ie. macOS and FreeBSD. As it causes crashes it's a critical bug for us. There are workarounds, but these are, well workarounds and no proper fixes.

Further description of the Kdenlive issue can be found here: https://invent.kde.org/multimedia/kdenlive/-/issues/1992

@darbyjohnston
Copy link
Contributor Author

@meshula provided some sample code for replacing the GenerateExportHeader functionality, I'm going to try integrating it and will change this PR to a "draft" while I work through it.

@darbyjohnston darbyjohnston marked this pull request as draft August 23, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A request for something new.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception when using CMAKE_CXX_VISIBILITY_PRESET=hidden
5 participants