diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-02-07 19:54:51 -0500 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-02-08 18:51:30 -0500 |
commit | 90dbe68b93020b3b8588753394e0e4014fa2b819 (patch) | |
tree | 946ea7b7058faca3446eb2c6b6e762c3251b618d /tools | |
parent | 06048b0e62197e0aa00b504e9de5d774e38ac8da (diff) |
Improve get_library() to create real library files
Also, enable caching of the libraries generated in tests in the new
get_library implementation.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/shared.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/shared.py b/tools/shared.py index 615f86e8..832dcb26 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -444,18 +444,18 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)'''.replace('$EMSCRIPTEN_ROOT', path_ stderr=open(os.path.join(project_dir, 'configure_err'), 'w'), env=env) Building.make(make + make_args, stdout=open(os.path.join(project_dir, 'make_'), 'w'), stderr=open(os.path.join(project_dir, 'make_err'), 'w'), env=env) - bc_file = os.path.join(project_dir, 'bc.bc') - Building.link(generated_libs, bc_file) if cache is not None: - cache[cache_name] = open(bc_file, 'rb').read() + cache[cache_name] = {} + for f in generated_libs: + cache[cache_name][f] = open(f, 'rb').read() if old_dir: os.chdir(old_dir) - return bc_file + return generated_libs @staticmethod def link(files, target): try_delete(target) - output = Popen([LLVM_LINK] + files + ['-o', target], stdout=PIPE).communicate()[0] + output = Popen([LLVM_LD, '-disable-opt'] + files + ['-b', target], stdout=PIPE).communicate()[0] assert os.path.exists(target) and (output is None or 'Could not open input file' not in output), 'Linking error: ' + output # Emscripten optimizations that we run on the .ll file |