build.plat: replace -+ characters in _all_toolchain_env_vars.

Mixed-case variables are allowed since af7c1144, but '-' or '+' must be
replaced to avoid invalid names (e.g. "$AMARANTH_ENV_oss-cad-suite").
This commit is contained in:
Jean-François Nguyen 2023-05-15 15:34:44 +02:00 committed by Catherine
parent a70cfa05cd
commit e9975587bf

View file

@ -76,7 +76,10 @@ class Platform(ResourceManager, metaclass=ABCMeta):
# TODO(amaranth-0.5): remove
@property
def _all_toolchain_env_vars(self):
return (f"AMARANTH_ENV_{self.toolchain}", self._toolchain_env_var,)
return (
f"AMARANTH_ENV_{self.toolchain.replace('-', '_').replace('+', 'X')}",
self._toolchain_env_var,
)
def build(self, elaboratable, name="top",
build_dir="build", do_build=True,