-
Notifications
You must be signed in to change notification settings - Fork 81
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
.rodata + position indepent code problems when building with BUILD_SHARED_LIBS=ON #264
Comments
vk-bootstrap is intended to be a static library due to the nature of the library being a small 'utility'. Having it be a separate shared-library isn't providing any real benefit in my opinion (performance & flexibility) Is |
I'm okay with vk-boostrap itself being a static lib, but I want my other libraries to be shared (the linking is much faster for me). So I guess |
Thats understandable, happy to take a PR to add it or create such a PR. |
Looks like we had the same idea. I took a slightly different approach, I wonder if there is any semantic different? Happy to take your PR, just curious your opinion. |
Ah looking into POSITION_INDEPENDENT_CODE more, it seems that a static library needs to have it enabled to be linked into a shared library, which makes sense but wasn't obvious. Which is why I prefer my PR because then you can forcibly set whether vk-bootstrap enables PIC directly, rather than have to set BUILD_SHARED_LIBS first. |
Thanks for working with me to get the library into a better state! Now I understand what that error message is referring two and should be better able to fix it (either automatically in the code or through dialoging with them, like this issue). |
When I build my project with
BUILD_SHARED_LIBS=ON
, I get the following linking error:The following the problem:
However, this makes me think: why is vk-boostrap marked as
STATIC
? I've tried compiling it as a shared library on Linux and didn't run into any issues. (For Windows build, you'd probably need dllimport/dllexport declspecs everywhere, though)So I think either
STATIC
should be dropped from theadd_library
call orPOSITION_INDEPENDENT_CODE
should be set by default (not sure if it'll break something).The text was updated successfully, but these errors were encountered: