Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions tools/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def parse_args(newargs): # noqa: C901, PLR0912, PLR0915
To revalidate these numbers, run `ruff check --select=C901,PLR091`.
"""
options = EmccOptions()
user_js_defines = []
should_exit = False
skip = False

Expand Down Expand Up @@ -588,7 +587,8 @@ def consume_arg_file():
value = '1'
if key in settings.keys():
exit_with_error(f'{arg}: cannot change built-in settings values with a -jsD directive. Pass -s{key}={value} instead!')
user_js_defines += [(key, value)]
# Apply user -jsD settings
settings[key] = value
newargs[i] = ''
elif check_flag('-shared'):
options.shared = True
Expand Down Expand Up @@ -642,7 +642,7 @@ def consume_arg_file():
sys.exit(0)

newargs = [a for a in newargs if a]
return options, user_js_defines, newargs
return options, newargs


def expand_byte_size_suffixes(value):
Expand Down Expand Up @@ -854,7 +854,7 @@ def parse_arguments(args):
newargs[i] += newargs[i + 1]
newargs[i + 1] = ''

options, user_js_defines, newargs = parse_args(newargs)
options, newargs = parse_args(newargs)

if options.post_link or options.oformat == OFormat.BARE:
diagnostics.warning('experimental', '--oformat=bare/--post-link are experimental and subject to change.')
Expand All @@ -871,10 +871,6 @@ def parse_arguments(args):
if strict_cmdline:
settings.STRICT = int(strict_cmdline)

# Apply user -jsD settings
for s in user_js_defines:
settings[s[0]] = s[1]

# Apply -s settings in newargs here (after optimization levels, so they can override them)
apply_user_settings()

Expand Down