Commit 8b12d93b authored by cmasone's avatar cmasone Committed by Commit bot

GN: Fix library flag generation logic

GN handles adding platform-appropriate prefixes to library
entries. As such, doing it here leads to stuff like '-l-lpython'
winding up in generated build files.

BUG=388412
TEST=use GN to generate build files for something that depends on cython
R=qsr@chromium.org

Review URL: https://codereview.chromium.org/563903002

Cr-Commit-Position: refs/heads/master@{#294606}
parent 9f6ce019
...@@ -34,12 +34,13 @@ def main(): ...@@ -34,12 +34,13 @@ def main():
result = [] result = []
if opts.libraries: if opts.libraries:
libraries = b.get_libraries(ext) libraries = b.get_libraries(ext)
if sys.platform in ['darwin', 'linux2']: if sys.platform == 'darwin':
# In case of darwin and linux prefix all libraries (if there is any) libraries.append('python%s' % sys.version[:3])
# so it can be used as a compiler argument. if not opts.gn and sys.platform in ['darwin', 'linux2']:
# In case of GYP output for darwin and linux prefix all
# libraries (if there are any) so the result can be used as a
# compiler argument. GN handles platform-appropriate prefixing itself.
libraries = ['-l%s' % library for library in libraries] libraries = ['-l%s' % library for library in libraries]
if sys.platform == 'darwin':
libraries.append('-lpython%s' % sys.version[:3])
result.extend(libraries) result.extend(libraries)
if opts.includes: if opts.includes:
result = result + b.include_dirs result = result + b.include_dirs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment