summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Winstein <keithw@cs.stanford.edu>2023-01-25 18:44:12 -0800
committerKeith Winstein <keithw@cs.stanford.edu>2023-01-25 18:44:12 -0800
commit4febf3ca39184ff9f9153beff9bbfcd8b9c42ca7 (patch)
treed2ebea8356f7c71aaccda5534ddb4160e64ac9d4
parent777e651edbe2a1931bd0d9746da5eaae8cc61ca9 (diff)
downloadwabt-4febf3ca39184ff9f9153beff9bbfcd8b9c42ca7.tar.gz
wabt-4febf3ca39184ff9f9153beff9bbfcd8b9c42ca7.tar.bz2
wabt-4febf3ca39184ff9f9153beff9bbfcd8b9c42ca7.zip
wasm2c: move WASM2C_CFLAGS to end of compiler command line
This allows overriding flags like -O2 by appending -O0 from the env var.
-rwxr-xr-xtest/run-spec-wasm2c.py4
-rw-r--r--test/utils.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/test/run-spec-wasm2c.py b/test/run-spec-wasm2c.py
index e9a93228..c8a1dfcb 100755
--- a/test/run-spec-wasm2c.py
+++ b/test/run-spec-wasm2c.py
@@ -440,7 +440,7 @@ def main(args):
default_compiler = 'cc'
if IS_WINDOWS:
default_compiler = 'cl.exe'
- default_compiler = os.getenv('CC', default_compiler)
+ default_compiler = os.getenv('WASM2C_CC', os.getenv('CC', default_compiler))
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--out-dir', metavar='PATH',
help='output directory for files.')
@@ -511,7 +511,7 @@ def main(args):
'--enable-multi-memory': options.enable_multi_memory})
options.cflags += shlex.split(os.environ.get('WASM2C_CFLAGS', ''))
- cc = utils.Executable(options.cc, *options.cflags, forward_stderr=True,
+ cc = utils.Executable(options.cc, after_args=options.cflags, forward_stderr=True,
forward_stdout=False)
cc.verbose = options.print_cmd
diff --git a/test/utils.py b/test/utils.py
index 20bac49c..2c115ad4 100644
--- a/test/utils.py
+++ b/test/utils.py
@@ -40,7 +40,7 @@ class Executable(object):
def __init__(self, exe, *before_args, **kwargs):
self.exe = exe
self.before_args = list(before_args)
- self.after_args = []
+ self.after_args = kwargs.get('after_args', [])
self.basename = kwargs.get('basename',
os.path.basename(exe)).replace('.exe', '')
self.error_cmdline = kwargs.get('error_cmdline', True)