From ecb8cba709c8764c7ad90d685a4960370407ecd6 Mon Sep 17 00:00:00 2001 From: Michael Allwright Date: Thu, 8 Aug 2024 12:19:19 +0200 Subject: [PATCH] Add setup_args and run `meson setup` explictly (#1223) Co-authored-by: James Sharpe --- foreign_cc/meson.bzl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/foreign_cc/meson.bzl b/foreign_cc/meson.bzl index 33f38a355..804a0ff5c 100644 --- a/foreign_cc/meson.bzl +++ b/foreign_cc/meson.bzl @@ -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, )) @@ -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