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

Static builds fail when PlutoSVG is enabled #516

Open
jered-as opened this issue Feb 23, 2025 · 0 comments
Open

Static builds fail when PlutoSVG is enabled #516

jered-as opened this issue Feb 23, 2025 · 0 comments
Assignees

Comments

@jered-as
Copy link

I'm using the https://github.com/Ravbug/sdl3-sample, but with the various SDL3, SDL3_ttf, etc updated to current releases or latest, trying to build everything statically on Windows with MSVC. If PlutoSVG is enabled the build fails at link time due to missing plutovg and plutosvg symbols. Everything works if I'm using shared libs, or if I build static libs but plutosvg is not enabled.

I noted that harfbuzz and freetype both mark their function definitions as extern, so I added that to plutosvg/plutovg function declarations and it didn't fix it. Then I realized that the source code is getting directly included in the SDL_ttf build, rather than linking against the plutosvg.lib or whatever, and saw that plutosvg/plutovg check for PLUTOSVG_BUILD_STATIC and PLUTOVG_BUILD_STATIC to detect static builds. So in the CMakeLists.txt for SDL_ttf, where it's adding the plutosvg source and headers for static builds, I added those defines for the SDL_ttf target, and now it compiles and runs fine.

I didn't dive any further than that though, could be missing something else as well to work correctly when building statically.

@madebr madebr self-assigned this Feb 23, 2025
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

2 participants