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

Fixes configure_library() in configure #3135

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,15 @@ def configure_library(lib, output):
if pkg_cflags:
output['include_dirs'] += (
filter(None, map(str.strip, pkg_cflags.split('-I'))))
elif options.__dict__[shared_lib + '_includes']:
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean to do shared_lib + '_includes' in options?

Copy link
Member

Choose a reason for hiding this comment

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

I'm inclined to think the __dict__ approach is correct here because it skips over empty flags.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bnoordhuis Oh, you are right. In that case, we can write this as if getattr(options, shared_lib + '_includes'):. But this also will work. So, I think its okay.

output['include_dirs'] += [options.__dict__[shared_lib + '_includes']]

# libpath needs to be provided ahead libraries
if pkg_libpath:
output['libraries'] += (
filter(None, map(str.strip, pkg_cflags.split('-L'))))
output['libraries'] += [pkg_libpath]
elif options.__dict__[shared_lib + '_libpath']:
output['libraries'] += [
'-L%s' % options.__dict__[shared_lib + '_libpath']]

default_libs = getattr(options, shared_lib + '_libname')
default_libs = map('-l{0}'.format, default_libs.split(','))
Expand Down