Skip to content

CMake: Prevent double SDL2 and SDL2main entries in sdl2.pc #9953

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

Merged

Conversation

sharkwouter
Copy link
Collaborator

Prevent double imports in pkgconf output.

Description

When building the sdl2.pc for the Playstation Portable, the Libs line looks like this:

Libs: -L${libdir}   -lSDL2main -lSDL2    -lSDL2main -lSDL2  -lm -lGL -lpspvram -lpspaudio -lpspvfpu -lpspdisplay -lpspgu -lpspge -lpsphprm -lpspctrl -lpsppower

That SDL2main and SDL2 are listed double is causing issues for us at the moment.

With this change it will look like this:

Libs: -L${libdir}   -lSDL2main -lSDL2     -lm -lGL -lpspvram -lpspaudio -lpspvfpu -lpspdisplay -lpspgu -lpspge -lpsphprm -lpspctrl -lpsppower

For other platforms is seems that this makes no difference for sdl2.pc either.

The CMake files that are generated have access to and use both SDL_LIBS and SDL_STATIC_LIBS variables when built and use both of them. It should not be needed to copy the content of SDL_LIBS into SDL_STATIC_LIBS. I tested on PSP with this change using find_package in CMake and I see no difference. Can someone verify this extra for at least one other platform before merging?

Existing Issue(s)

@sharkwouter sharkwouter merged commit 295266c into libsdl-org:SDL2 Jun 3, 2024
37 checks passed
@sharkwouter sharkwouter deleted the fix-double-libs-in-pkgconfig branch June 3, 2024 12:49
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

Successfully merging this pull request may close these issues.

2 participants