Skip to content

Commit

Permalink
Configure STRIP tool for meson
Browse files Browse the repository at this point in the history
  • Loading branch information
mering committed Oct 16, 2024
1 parent 3c433dd commit 95a7883
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions foreign_cc/meson.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def _create_meson_script(configureParameters):
script.append("##export_var## CXX {}".format(_absolutize(ctx.workspace_name, tools.cxx)))
if " " not in tools.cxx_linker_static:
script.append("##export_var## AR {}".format(_absolutize(ctx.workspace_name, tools.cxx_linker_static)))
if tools.strip and " " not in tools.strip:
script.append("##export_var## STRIP {}".format(_absolutize(ctx.workspace_name, tools.strip)))

# set flags same as foreign_cc/private/cc_toolchain_util.bzl
# cannot use get_flags_info() because bazel adds additional flags that
Expand Down
8 changes: 8 additions & 0 deletions foreign_cc/private/cc_toolchain_util.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CxxToolsInfo = provider(
cxx_linker_static = "C++ linker to link static library",
cxx_linker_executable = "C++ linker to link executable",
ld = "linker",
strip = "Binary symbol stripper",
),
)

Expand Down Expand Up @@ -218,6 +219,13 @@ def get_tools_info(ctx):
action_name = ACTION_NAMES.cpp_link_executable,
),
ld = cc_toolchain.ld_executable,
strip = cc_common.get_tool_for_action(
feature_configuration = feature_configuration,
action_name = ACTION_NAMES.strip,
) if cc_common.action_is_enabled(
feature_configuration = feature_configuration,
action_name = ACTION_NAMES.strip,
) else "",
)

def get_flags_info(ctx, link_output_file = None):
Expand Down

0 comments on commit 95a7883

Please sign in to comment.