exec(open(os.path.expanduser('~/.emscripten'), 'r').read()) sys.path.append(EMSCRIPTEN_ROOT) import tools.shared as emscripten EMSCRIPTEN_SETTINGS = { 'SKIP_STACK_IN_SMALL': 1, 'INIT_STACK': 0, 'PGO': 0, 'CHECK_OVERFLOWS': 0, 'CHECK_SIGNED_OVERFLOWS': 0, 'CORRECT_OVERFLOWS': 0, 'CHECK_SIGNS': 0, 'CORRECT_SIGNS': 2, 'CORRECT_SIGNS_LINES': emscripten.read_pgo_data('avc.pgo')['signs_lines'], 'DISABLE_EXCEPTION_CATCHING': 1, 'RUNTIME_TYPE_INFO': 0, 'TOTAL_MEMORY': 50*1024*1024, 'FAST_MEMORY': 12*1024*1024, 'PROFILE': 0, 'MICRO_OPTS': 1, 'RELOOP': 1, # XXX 1 makes compilation slower! 'USE_TYPED_ARRAYS': 2, 'USE_FHEAP': 0, 'SAFE_HEAP': 0, 'ASSERTIONS': 0, 'QUANTUM_SIZE': 4, 'INVOKE_RUN': 0, # we do it ourselves 'EXPORTED_FUNCTIONS': ['_main', '__Z11runMainLoopv'], 'IGNORED_FUNCTIONS': ['_paint'],
'INVOKE_RUN': 0, # we do it ourselves 'EXPORTED_FUNCTIONS': ['_main', '__Z11runMainLoopv'], 'IGNORED_FUNCTIONS': ['_paint'], } use_pgo = True profile = False if profile: EMSCRIPTEN_SETTINGS['CHECK_SIGNS'] = 1 EMSCRIPTEN_SETTINGS['CHECK_OVERFLOWS'] = 1 EMSCRIPTEN_SETTINGS['PGO'] = 1 use_profile = use_pgo and not profile if use_profile: pgo_data = emscripten.read_pgo_data('avc.pgo') EMSCRIPTEN_SETTINGS['CORRECT_SIGNS'] = 2 EMSCRIPTEN_SETTINGS['CORRECT_SIGNS_LINES'] = pgo_data['signs_lines'] EMSCRIPTEN_SETTINGS['CORRECT_OVERFLOWS'] = 2 EMSCRIPTEN_SETTINGS['CORRECT_OVERFLOWS_LINES'] = pgo_data['overflows_lines'] # print EMSCRIPTEN_SETTINGS EMSCRIPTEN_ARGS = ['--optimize'] #['--dlmalloc'] # Optimize does not appear to help JS_DIR = "js" if not os.path.exists(JS_DIR): os.makedirs(JS_DIR) build_level = 0