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

Allow linking with -lSDL2_mixer to work properly #12633

Merged
merged 7 commits into from
Oct 30, 2020
Merged

Allow linking with -lSDL2_mixer to work properly #12633

merged 7 commits into from
Oct 30, 2020

Conversation

kripken
Copy link
Member

@kripken kripken commented Oct 28, 2020

This did not just work because we build libSDL2_mixer_ogg etc., with a suffix
for the codecs we build in. This PR adds an explicit mapping to handle such
cases.

Also improve the test to check this, and add a lot more checks there, like that
we don't use SDL1 somehow (which can happen with files like this where the
SDL1 and SDL2 APIs agree, and so SDL2 does not need to be linked in to
get a running executable).

Fixes #12589

@kripken kripken requested a review from sbc100 October 28, 2020 23:38
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Quite a simple solution.

if library_name in library_map:
for key, value in library_map[library_name]:
logger.debug('Mapping library `%s` to settings changes: %s = %s' % (library_name, key, value))
shared.Settings.__setattr__(key, value)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does setattr(shared.Settings, key, value) not work here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, not sure why I didn't do that before...

@@ -3150,6 +3150,8 @@ def process_libraries(libs, lib_dirs, temp_files):
if jslibs is not None:
libraries += [(i, jslib) for jslib in jslibs]
consumed.append(i)
elif building.map_and_apply_to_settings(lib):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just be map_to_settings ? I'm not sure either is that descriptive so I'm fine either way.

I guess if it was called map_to_settings then it would return the new settings and you would apply it here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but then returning a list of key mappings and applying them seems odd. a pretty complex interface, compared to just applying them there.

@kripken kripken merged commit 7858fcc into master Oct 30, 2020
@kripken kripken deleted the auto branch October 30, 2020 18:56
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.

Support -lSDL2_mixer and others
2 participants