Skip to content

Conversation

@th-skam
Copy link
Collaborator

@th-skam th-skam commented Sep 18, 2025

Based on #88
Close #91

@th-skam th-skam force-pushed the cmake-expose-symbols branch from 6026302 to 61ab62c Compare September 19, 2025 22:24
@th-skam th-skam force-pushed the cmake-expose-symbols branch from 61ab62c to 7a96515 Compare September 19, 2025 22:39
@th-skam th-skam added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip labels Sep 19, 2025
Copy link
Contributor

@epernod epernod left a comment

Choose a reason for hiding this comment

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

Seems good to me. Let's double check with the ci.

@th-skam
Copy link
Collaborator Author

th-skam commented Sep 22, 2025

Not sure whether I should export this one:

template<class ELMT>
class ElementContainer {

It's an internal container in BaseElement. It is however part of the public API:

class BaseElement {
public:
typedef std::shared_ptr<BaseElement> SPtr;
virtual const ElementContainer<PointElement> & pointElements() const = 0;//{ return m_pointElements; }
virtual const ElementContainer<EdgeElement> & edgeElements() const = 0;//{ return m_edgeElements; }
virtual const ElementContainer<TriangleElement> & triangleElements() const = 0;//{ return m_triangleElements; }
virtual const ElementContainer<TetrahedronElement> & tetrahedronElements() const = 0;//{ return m_tetrahedronElements; }

We have to export this in such a case right?

@epernod
Copy link
Contributor

epernod commented Sep 24, 2025

Not sure whether I should export this one:

template<class ELMT>
class ElementContainer {

It's an internal container in BaseElement. It is however part of the public API:

class BaseElement {
public:
typedef std::shared_ptr<BaseElement> SPtr;
virtual const ElementContainer<PointElement> & pointElements() const = 0;//{ return m_pointElements; }
virtual const ElementContainer<EdgeElement> & edgeElements() const = 0;//{ return m_edgeElements; }
virtual const ElementContainer<TriangleElement> & triangleElements() const = 0;//{ return m_triangleElements; }
virtual const ElementContainer<TetrahedronElement> & tetrahedronElements() const = 0;//{ return m_tetrahedronElements; }

We have to export this in such a case right?

If you think it should be accessible from outside, for exemple form a thrid party library or plugin, yes you need to add the API macro.

Edit: I didn't see it was a template class. The Macro need to be added to the template instantiation only. Like here:

template class SOFA_COLLISIONALGORITHM_API EdgeGeometry<sofa::defaulttype::Vec3dTypes>;

@epernod epernod merged commit d15d64a into master Sep 24, 2025
4 checks passed
@epernod epernod deleted the cmake-expose-symbols branch September 24, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: enhancement pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cmake] Export classes with API macro mechanism properly

3 participants