Skip to content

Commit

Permalink
Do not clobber user environment variables in Meson script (bazel-cont…
Browse files Browse the repository at this point in the history
  • Loading branch information
allsey87 authored Aug 10, 2024
1 parent 509b5aa commit 2375e1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions foreign_cc/meson.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ def _create_meson_script(configureParameters):
cxxopts = (ctx.fragments.cpp.copts + ctx.fragments.cpp.cxxopts + getattr(ctx.attr, "copts", [])) or []

if copts:
script.append("##export_var## CFLAGS \"{}\"".format(" ".join(copts).replace("\"", "'")))
script.append("##export_var## CFLAGS \"{} ${{CFLAGS:-}}\"".format(" ".join(copts).replace("\"", "'")))
if cxxopts:
script.append("##export_var## CXXFLAGS \"{}\"".format(" ".join(cxxopts).replace("\"", "'")))
script.append("##export_var## CXXFLAGS \"{} ${{CXXFLAGS:-}}\"".format(" ".join(cxxopts).replace("\"", "'")))

flags = get_flags_info(ctx)
if flags.cxx_linker_executable:
script.append("##export_var## LDFLAGS \"{}\"".format(" ".join(flags.cxx_linker_executable).replace("\"", "'")))
script.append("##export_var## LDFLAGS \"{} ${{LDFLAGS:-}}\"".format(" ".join(flags.cxx_linker_executable).replace("\"", "'")))

script.append("##export_var## CMAKE {}".format(attrs.cmake_path))
script.append("##export_var## NINJA {}".format(attrs.ninja_path))
Expand Down

0 comments on commit 2375e1d

Please sign in to comment.