Skip to content

Commit

Permalink
gh-93939: Use new MODULE_name_STATE in wasm_assets script (GH-95035)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0f34c7e)

Co-authored-by: Christian Heimes <[email protected]>
  • Loading branch information
miss-islington and tiran committed Jul 20, 2022
1 parent 84d58ad commit e98728a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Tools/wasm/wasm_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,13 @@ def detect_extension_modules(args: argparse.Namespace):
loc = {}
exec(data, globals(), loc)

for name, value in loc["build_time_vars"].items():
if value not in {"yes", "missing", "disabled", "n/a"}:
for key, value in loc["build_time_vars"].items():
if not key.startswith("MODULE_") or not key.endswith("_STATE"):
continue
if not name.startswith("MODULE_"):
continue
if name.endswith(("_CFLAGS", "_DEPS", "_LDFLAGS")):
continue
modname = name.removeprefix("MODULE_").lower()
if value not in {"yes", "disabled", "missing", "n/a"}:
raise ValueError(f"Unsupported value '{value}' for {key}")

modname = key[7:-6].lower()
if modname not in modules:
modules[modname] = value == "yes"
return modules
Expand Down

0 comments on commit e98728a

Please sign in to comment.