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

Update code and build to set explicitly the kim-api symbol visibility #69

Open
ellio167 opened this issue Jan 5, 2021 · 0 comments
Open

Comments

@ellio167
Copy link
Member

ellio167 commented Jan 5, 2021

This is a low priority, but can be considered a "best practice". The idea is to set symbol visibility so that only the public parts of the api are visible at link time. This makes it so that users (who have access to the implementation code) cannot use (link to) non-public parts of the api implementation in their code.

Exactly how best to achieve this is not clear. It seems like a set of preprocessor definitions is a good way to go. But exactly what those should be is not obvious.

CMake has some support/awareness of this issue and it would be best to find a "CMake approved" approach to this, so that it doesn't depend on the compilers and/or system on which the build is happening.

Here are some links that may be useful:
https://stackoverflow.com/questions/39981491/c-symbol-visibility-in-static-archives

https://stackoverflow.com/questions/17080869/what-is-the-cmake-equivalent-to-gcc-fvisibility-hidden-when-controlling-the-e

https://phabricator.kde.org/T11490

https://libcork.io/0.15.0/visibility.html

https://dev.to/vejmartin/dll-symbol-visibility-in-c-36ip

https://gist.github.com/ax3l/ba17f4bb1edb5885a6bd01f58de4d542

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

No branches or pull requests

1 participant