diff options
author | Chad Austin <chad@imvu.com> | 2013-01-30 18:11:51 -0800 |
---|---|---|
committer | Chad Austin <chad@imvu.com> | 2013-03-04 19:31:47 -0800 |
commit | 14833940f45cfea351e571f486d68c685cb9239f (patch) | |
tree | f183301036ca689f4314a6ae67073dabbe7a7a54 | |
parent | c919d824ac44031f00f925b5c44e86ac6c393292 (diff) |
Have emscripten.py access the cache module and instantiate objects to break another dependency on shared.py
-rwxr-xr-x | emscripten.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/emscripten.py b/emscripten.py index 4f3f2a77..26a018ae 100755 --- a/emscripten.py +++ b/emscripten.py @@ -11,9 +11,7 @@ headers, for the libc implementation in JS). import os, sys, json, optparse, subprocess, re, time, multiprocessing, functools -from tools import shared -from tools import jsrun -from tools import cache +from tools import shared, jsrun, cache as cache_module __rootpath__ = os.path.abspath(os.path.dirname(__file__)) def path_from_root(*pathelems): @@ -190,7 +188,7 @@ def emscript(configuration, infile, settings, outfile, libraries=[], settings['EXPORTED_FUNCTIONS'] = forwarded_json['EXPORTED_FUNCTIONS'] save_settings() - chunks = shared.chunkify( + chunks = cache_module.chunkify( funcs, chunk_size, jcache.get_cachename('emscript_files') if jcache else None) @@ -501,7 +499,7 @@ Runtime.stackRestore = function(top) { asm.stackRestore(top) }; outfile.close() -def main(args, compiler_engine, jcache, relooper): +def main(args, compiler_engine, cache, jcache, relooper): # Prepare settings for serialization to JSON. settings = {} for setting in args.settings: @@ -577,7 +575,7 @@ def main(args, compiler_engine, jcache, relooper): # Compile the assembly to Javascript. if settings.get('RELOOP'): if not relooper: - relooper = shared.Cache.get_path('relooper.js') + relooper = cache.get_path('relooper.js') settings.setdefault('RELOOPER', relooper) shared.Building.ensure_relooper(relooper) @@ -645,10 +643,12 @@ WARNING: You should normally never use this! Use emcc instead. else: relooper = None # use the cache + cache = cache_module.Cache() temp_files.run_and_clean(lambda: main( keywords, compiler_engine=os.path.abspath(keywords.compiler), - jcache=shared.JCache if keywords.jcache else None, + cache=cache, + jcache=cache_module.JCache(cache) if keywords.jcache else None, relooper=relooper)) if __name__ == '__main__': |