Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

handle absolute paths in .a files

  • Loading branch information...
commit c6de9619dac086caf56803141202e9ff8354b259 1 parent 8b86272
@kripken authored
Showing with 6 additions and 7 deletions.
  1. +6 −7 tools/shared.py
View
13 tools/shared.py
@@ -528,13 +528,12 @@ def link(files, target):
if not os.path.exists('ar_output'):
os.makedirs('ar_output')
os.chdir('ar_output')
- Popen([LLVM_AR, 'x', f], stdout=PIPE).communicate()
- added = False
- for name in os.listdir(os.getcwd()):
- actual_files.append(os.path.join(EMSCRIPTEN_TEMP_DIR, 'ar_output', name))
- added = True
- if not added:
- print >> sys.stderr, 'Warning: Archive %s appears to be empty' % f
+ contents = filter(lambda x: len(x) > 0, Popen([LLVM_AR, 't', f], stdout=PIPE).communicate()[0].split('\n'))
+ if len(contents) == 0:
+ print >> sys.stderr, 'Warning: Archive %s appears to be empty (recommendation: link an .so instead of .a)' % f
+ else:
+ Popen([LLVM_AR, 'x', f], stdout=PIPE).communicate() # if absolute paths, files will appear there. otherwise, in this directory
+ actual_files += map(os.path.abspath, contents)
finally:
os.chdir(cwd)
else:
Please sign in to comment.
Something went wrong with that request. Please try again.