From 98d45f819088ce53ec248b49261b4a6dc28794bc Mon Sep 17 00:00:00 2001 From: Daniel <86781586+0xDS@users.noreply.github.com> Date: Sun, 2 Feb 2025 23:51:52 +1400 Subject: [PATCH] Update props.py Added filtering logic based on the included/excluded items in ns --- PC/layout/support/props.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PC/layout/support/props.py b/PC/layout/support/props.py index f751a4b3f1e437..e455f15f567695 100644 --- a/PC/layout/support/props.py +++ b/PC/layout/support/props.py @@ -82,7 +82,6 @@ def get_props_layout(ns): if ns.include_all or ns.include_props: - # TODO: Filter contents of props file according to included/excluded items d = dict(PROPS_DATA) if not d.get("PYTHON_PLATFORM"): d["PYTHON_PLATFORM"] = { @@ -91,5 +90,13 @@ def get_props_layout(ns): "arm32": "ARM", "arm64": "ARM64", }[ns.arch] + # Filtering logic based on the included/excluded items in ns + if not ns.include_all: + if not ns.include_exe: + d["PYTHON_TARGET"] = d["PYTHON_TARGET"].replace('python*.exe', '') + if not ns.include_dll: + d["PYTHON_TARGET"] = d["PYTHON_TARGET"].replace('python*.dll', '') + if not ns.include_libs: + d["PYTHON_TARGET"] = "" props = PROPS_TEMPLATE.format_map(d) yield "python.props", ("python.props", props.encode("utf-8"))