From daf1f91f1338bbafc9390c8f4ffa881e4731ba84 Mon Sep 17 00:00:00 2001 From: Tim Lander Date: Thu, 23 May 2019 14:09:48 +0800 Subject: [PATCH] Revert "Fix WASM=0 warning in gen_struct_info (#8497)" This reverts commit 8d3b17805999ef16e58176d637b4bc076249f0f3. --- embuilder.py | 10 +++++----- tools/gen_struct_info.py | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/embuilder.py b/embuilder.py index 6e01494e2578..a38b00e361d3 100755 --- a/embuilder.py +++ b/embuilder.py @@ -11,7 +11,6 @@ from __future__ import print_function import logging import os -import subprocess import sys from tools import shared @@ -148,10 +147,11 @@ def build(src, result_libs, args=[]): cpp = os.path.join(temp_dir, 'src.cpp') open(cpp, 'w').write(src) temp_js = os.path.join(temp_dir, 'out.js') - try: - shared.Building.emcc(cpp, args, output_filename=temp_js) - except subprocess.CalledProcessError as e: - shared.exit_with_error("embuilder: emcc command failed with %d: '%s'", e.returncode, ' '.join(e.cmd)) + shared.Building.emcc(cpp, args, output_filename=temp_js) + + # verify + if not os.path.exists(temp_js): + shared.exit_with_error('failed to build file') for lib in result_libs: if not os.path.exists(shared.Cache.get_path(lib)): diff --git a/tools/gen_struct_info.py b/tools/gen_struct_info.py index a994dece2727..f6368ecff6c4 100755 --- a/tools/gen_struct_info.py +++ b/tools/gen_struct_info.py @@ -388,9 +388,7 @@ def inspect_code(headers, cpp_opts, structs, defines): # Compile the program. show('Compiling generated code...') # -Oz optimizes enough to avoid warnings on code size/num locals - cmd = [shared.PYTHON, shared.EMCC] + cpp_opts + ['-o', js_file[1], src_file[1], '-s', 'BOOTSTRAPPING_STRUCT_INFO=1', '-s', 'WARN_ON_UNDEFINED_SYMBOLS=0', '-O0', '--js-opts', '0', '--memory-init-file', '0', '-s', 'SINGLE_FILE=1', '-Wno-format'] - if not shared.Settings.WASM_BACKEND: - cmd += ['-s', 'WASM=0'] + cmd = [shared.PYTHON, shared.EMCC] + cpp_opts + ['-o', js_file[1], src_file[1], '-s', 'BOOTSTRAPPING_STRUCT_INFO=1', '-s', 'WARN_ON_UNDEFINED_SYMBOLS=0', '-O0', '--js-opts', '0', '--memory-init-file', '0', '-s', 'SINGLE_FILE=1', '-s', 'WASM=0', '-Wno-format'] if shared.Settings.WASM_OBJECT_FILES: cmd += ['-s', 'WASM_OBJECT_FILES=1']