Skip to content

Commit

Permalink
Add setup_args and run meson setup explictly (bazel-contrib#1223)
Browse files Browse the repository at this point in the history
Co-authored-by: James Sharpe <[email protected]>
  • Loading branch information
allsey87 and jsharpe committed Aug 23, 2024
1 parent f80d029 commit ecb8cba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion foreign_cc/meson.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ def _create_meson_script(configureParameters):

prefix = "{} ".format(expand_locations_and_make_variables(ctx, attrs.tool_prefix, "tool_prefix", data)) if attrs.tool_prefix else ""

script.append("{prefix}{meson} --prefix={install_dir} {options} {source_dir}".format(
setup_args_str = " ".join(expand_locations_and_make_variables(ctx, ctx.attr.setup_args, "setup_args", data))

script.append("{prefix}{meson} setup --prefix={install_dir} {setup_args} {options} {source_dir}".format(
prefix = prefix,
meson = attrs.meson_path,
install_dir = "$$INSTALLDIR$$",
setup_args = setup_args_str,
options = options_str,
source_dir = "$$EXT_BUILD_ROOT$$/" + root,
))
Expand Down Expand Up @@ -171,6 +174,10 @@ def _attrs():
mandatory = False,
default = {},
),
"setup_args": attr.string_list(
doc = "Arguments for the Meson setup command",
mandatory = False,
),
})
return attrs

Expand Down

0 comments on commit ecb8cba

Please sign in to comment.