-
Notifications
You must be signed in to change notification settings - Fork 115
feat: Explicitly mark exported API #437
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
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #437 +/- ##
===========================================
- Coverage 83.59% 79.70% -3.90%
===========================================
Files 24 23 -1
Lines 8119 6213 -1906
Branches 1694 1633 -61
===========================================
- Hits 6787 4952 -1835
+ Misses 1332 1261 -71
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
c63a969
to
32d8def
Compare
950f2eb
to
ce7911c
Compare
ce7911c
to
47b4a9c
Compare
@LecrisUT, could you tell me how the macros in |
Basically the default symbol visibility is changed to hidden, but that means the unit tests would not be able to find the symbols, even though it has access to the internal headers. So, as a workaround, we patch the logic to export those symbols when the test-suite is being built with unit tests. The other approaches I've seen are:
|
#include "spglib.h" | ||
|
||
#ifdef SPG_TESTING | ||
#define SPG_API_TEST SPG_API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is SPG_API
used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's defined in spglib.h
and it's used to export/import funtions to/from dll. On unix it only does export
Can you leave a document on |
Ok, I've added a note about |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
c569738
to
c21cda3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The note Exposing API for unit tests
looks concise and simple for contributors.
Windows systems are quite weird where you have to define both when you import and export stuff. Previously in the CI we got around it by building as static, but that is not appropriate as we've seen with the C# interface discussion 1.
@husakm can you try this one out?
Footnotes
https://github.com/spglib/spglib/discussions/399#discussioncomment-8207195 ↩