From 6ee5fbfffbcd32eb51eeabd15a93d332fa0840ad Mon Sep 17 00:00:00 2001 From: Michael Allwright Date: Mon, 8 Jul 2024 11:03:17 +0000 Subject: [PATCH 1/2] Add setup_args and run `meson setup` explictly --- 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..f82a82c1f 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, )) @@ -152,6 +155,10 @@ def _attrs(): attrs = dict(CC_EXTERNAL_RULE_ATTRIBUTES) attrs.update({ + "setup_args": attr.string_list( + doc = "Arguments for the Meson setup command", + mandatory = False, + ), "build_args": attr.string_list( doc = "Arguments for the Meson build command", mandatory = False, From c7bcf7d41a5514bedccbd1f781b4fbf34923c712 Mon Sep 17 00:00:00 2001 From: Michael Allwright Date: Tue, 9 Jul 2024 18:05:33 +0200 Subject: [PATCH 2/2] Update meson.bzl Place dictionary items in lexicographical order --- foreign_cc/meson.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/foreign_cc/meson.bzl b/foreign_cc/meson.bzl index f82a82c1f..804a0ff5c 100644 --- a/foreign_cc/meson.bzl +++ b/foreign_cc/meson.bzl @@ -155,10 +155,6 @@ def _attrs(): attrs = dict(CC_EXTERNAL_RULE_ATTRIBUTES) attrs.update({ - "setup_args": attr.string_list( - doc = "Arguments for the Meson setup command", - mandatory = False, - ), "build_args": attr.string_list( doc = "Arguments for the Meson build command", mandatory = False, @@ -178,6 +174,10 @@ def _attrs(): mandatory = False, default = {}, ), + "setup_args": attr.string_list( + doc = "Arguments for the Meson setup command", + mandatory = False, + ), }) return attrs