@@ -179,7 +179,7 @@ def apply_static_code_hooks(forwarded_json, code):
179179 return code
180180
181181
182- def compile_settings ( ):
182+ def compile_javascript ( symbols_only = False ):
183183 stderr_file = os .environ .get ('EMCC_STDERR_FILE' )
184184 if stderr_file :
185185 stderr_file = os .path .abspath (stderr_file )
@@ -199,11 +199,18 @@ def compile_settings():
199199 # Call js compiler
200200 env = os .environ .copy ()
201201 env ['EMCC_BUILD_DIR' ] = os .getcwd ()
202+ args = [settings_file ]
203+ if symbols_only :
204+ args += ['--symbols-only' ]
202205 out = shared .run_js_tool (path_from_root ('src/compiler.js' ),
203- [ settings_file ] , stdout = subprocess .PIPE , stderr = stderr_file ,
206+ args , stdout = subprocess .PIPE , stderr = stderr_file ,
204207 cwd = path_from_root ('src' ), env = env , encoding = 'utf-8' )
205- assert '//FORWARDED_DATA:' in out , 'Did not receive forwarded data in pre output - process failed?'
206- glue , forwarded_data = out .split ('//FORWARDED_DATA:' )
208+ if symbols_only :
209+ glue = None
210+ forwarded_data = out
211+ else :
212+ assert '//FORWARDED_DATA:' in out , 'Did not receive forwarded data in pre output - process failed?'
213+ glue , forwarded_data = out .split ('//FORWARDED_DATA:' )
207214 return glue , forwarded_data
208215
209216
@@ -367,7 +374,7 @@ def emscript(in_wasm, out_wasm, outfile_js, memfile):
367374 if invoke_funcs :
368375 settings .DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += ['$getWasmTableEntry' ]
369376
370- glue , forwarded_data = compile_settings ()
377+ glue , forwarded_data = compile_javascript ()
371378 if DEBUG :
372379 logger .debug (' emscript: glue took %s seconds' % (time .time () - t ))
373380 t = time .time ()
0 commit comments