feat: Explicitly mark exported API#437
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.
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 <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
c569738 to
c21cda3
Compare
lan496
left a comment
There was a problem hiding this comment.
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 ↩