-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Conversation
There was a problem hiding this 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.
tools/building.py
Outdated
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
This did not just work because we build
libSDL2_mixer_ogg
etc., with a suffixfor 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