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

CMake: fix static linkage of SDL2 and use static SDL2 by default #1929

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paroj
Copy link
Member

@paroj paroj commented Mar 18, 2021

No description provided.

@paroj paroj marked this pull request as draft March 19, 2021 23:54
@paroj paroj deleted the branch OGRECave:master September 13, 2022 11:03
@paroj paroj closed this Sep 13, 2022
@paroj paroj reopened this Sep 13, 2022
@paroj paroj changed the base branch from master1 to master September 13, 2022 23:28
@Apteryks
Copy link
Contributor

Apteryks commented Nov 7, 2024

Why would you want to use static linkage to SDL2 by default?

@paroj
Copy link
Member Author

paroj commented Nov 7, 2024

ease of shipping and a smaller binary.

Note, that this assumes you only use OgreBites and not any SDL2 API on top. However, this is guaranteed for our precompiled SDK or the Python package.

@Apteryks
Copy link
Contributor

Apteryks commented Nov 8, 2024

ease of shipping and a smaller binary.

Smaller binary? That's surprising, given static means it has to bundle all the needed symbols; smaller binaries are typically one of the advantages touted by dynamic linkage.

Note, that this assumes you only use OgreBites and not any SDL2 API on top. However, this is guaranteed for our precompiled SDK or the Python package.

I'm not sure I understand the subtlety here, but as a package manager, my biased opinion would be that shared linkage by default makes more sense. Static linkage can always be requested by the Ogre SDK build scripts or in the specific cases where it is desired.

My 2 cents :-).

@paroj
Copy link
Member Author

paroj commented Nov 8, 2024

ok, this issue is written from the snap/ windows/ flatpak/ PIP perspective, where we bundle all our dependencies and none of them can be shared with other processes.

Here, static linkage means only the symbols we use are shipped, while a shared lib comes with all symbols and we need to copy it to the correct location.

Distributions on the other hand can use OGRE_BUILD_DEPENDENCIES=OFF and do whatever they want.

@Apteryks
Copy link
Contributor

Apteryks commented Nov 9, 2024

I see, thanks for the explanations. I had overlooked that this change would only affect the building & linking of bundled dependencies. If this leaves a system-provided SDL2 to be linked dynamically, then I have nothing to say :-).

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