Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug with dynamic plugins loading #2725

Merged
merged 1 commit into from
Oct 8, 2022

Conversation

gui-co
Copy link
Contributor

@gui-co gui-co commented Oct 5, 2022

This tiny PR fixes an issue that prevents the loading of dynamic plugins into Stellarium.

Description

With the introduction of CMP0065 in cmake 3.4, the symbols are not automatically exported for executables. When a dynamic plugin is loaded into Stellarium, an undefined symbol error occurs.

The ENABLE_EXPORTS property has been set for the executable.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update

How Has This Been Tested?

To test, one can build and install the StellariumPluginTemplate. On master, this should give an undefined symbol: _ZN10StelModule16staticMetaObjectE) error when Stellarium tries to load the plugin. On this PR, the plugin is properly loaded.

Test Configuration:

  • Operating system: ArchLinux

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

The export of symbols from the executables was disabled with cmake 3.4.
This was preventing the loading of dynamic plugins in stellarium.
see https://cmake.org/cmake/help/v3.4/policy/CMP0065.html
@github-actions github-actions bot requested review from alex-w and gzotti October 5, 2022 23:19
@alex-w alex-w added this to the 1.1 milestone Oct 6, 2022
Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Thank you!

@alex-w alex-w merged commit 13a0dc9 into Stellarium:master Oct 8, 2022
@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Oct 12, 2022
@github-actions
Copy link

Hello @gui-co!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@gui-co
Copy link
Contributor Author

gui-co commented Oct 12, 2022

Happy to contribute.
Thanks for the merge and for Stellarium in general!

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Oct 31, 2022
@github-actions
Copy link

Hello @gui-co!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants