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

Underlinking to SDL2 #10

Open
khumba opened this issue Nov 29, 2024 · 3 comments
Open

Underlinking to SDL2 #10

khumba opened this issue Nov 29, 2024 · 3 comments

Comments

@khumba
Copy link

khumba commented Nov 29, 2024

Hi @jorio,

TL;DR: Would you consider adding an explicit dependency on SDL2's library to Pomme's CMakeLists.txt?

target_link_libraries(${PROJECT_NAME} SDL2)

I'm not sure how interested you are in downstream packaging issues, but there is a correctness issue with libPomme.so underlinking to libSDL2.so -- it depends on symbols from libSDL2.so but doesn't declare a NEEDED dependency on it, because the above CMake command is missing. I understand that Pomme is bundled in your games' builds which do link correctly, so this doesn't matter in practice for you. But it comes up when packaging for distros, where bundled libraries are split out into their own packages (which I've done) and automated QA will check for shared libraries not declaring dependencies properly.

I've patched this in my (unofficial) Debian builds and and have a ticket for myself to fix my (also unofficial) Gentoo builds[1], but I thought first I would check if you'd be willing to add the necessary line upstream.

Thanks!

[1] https://todo.sr.ht/~khumba/khoverlay/21

@jorio
Copy link
Owner

jorio commented Dec 1, 2024

Hi @khumba! Unfortunately this line breaks the Mac and Windows builds of the games (carried out through CI script build.py in each game).

My binary distributions of the games all link Pomme as a static lib, because I originally made it evolve with each new port without much concern for backwards compatibility with older ports. To be safe, I’d recommend linking Pomme statically for this reason, although that’s more or less moot today (all games have been updated to a recent-ish commit of Pomme and I don’t have new ports in the works for now).

That said, if you want to distribute Pomme as a shared library, perhaps we could gate the target_link_libraries statement with a special flag so that the Mac/Windows build process doesn’t need to change.

@jorio
Copy link
Owner

jorio commented Feb 8, 2025

An update on this: I'm updating the Pangea games to SDL3, and in the process I've implemented your suggestion (ced44f2 on branch 'sdl3-wip').

I'm waiting for Flatpak runtimes to start shipping SDL3 before I cut new releases for the games. In the meantime, the first game that is SDL3 ready is Mighty Mike. Let me know if this works for your purposes.

@khumba
Copy link
Author

khumba commented Feb 9, 2025 via email

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