Skip to content

Commit

Permalink
Fix application of global environment variables in configure phase
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans committed Oct 16, 2024
1 parent c2d5378 commit 1f1491d
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion metapkg/targets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ def sh_append_global_flags(
args = {}
conf_args = dict(args)
for k, v in self.target.get_global_env(self).items():
self.sh_append_flags(conf_args, k, [v])
self.sh_replace_flags(conf_args, k, [v])
if global_cflags:
self.sh_append_flags(conf_args, "CFLAGS", global_cflags)
if global_cxxflags:
Expand Down Expand Up @@ -2060,6 +2060,36 @@ def sh_prepend_quoted_flags(
) -> None:
self.sh_combine_quoted_flags(args, key, flags, sep=sep, how="prepend")

def sh_replace_flags(
self,
args: dict[str, str | pathlib.Path | None],
key: str,
flags: list[str] | tuple[str, ...],
*,
sep: str = '" "',
) -> None:
self.sh_replace_quoted_flags(
args,
key,
self.sh_quote_flags(flags),
sep=sep,
)

def sh_prepend_flags(
self,
args: dict[str, str | pathlib.Path | None],
key: str,
flags: list[str] | tuple[str, ...],
*,
sep: str = '" "',
) -> None:
self.sh_prepend_quoted_flags(
args,
key,
self.sh_quote_flags(flags),
sep=sep,
)

def sh_append_flags(
self,
args: dict[str, str | pathlib.Path | None],
Expand Down

0 comments on commit 1f1491d

Please sign in to comment.