Skip to content

Commit 95a7883

Browse files
committed
Configure STRIP tool for meson
1 parent 3c433dd commit 95a7883

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

foreign_cc/meson.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def _create_meson_script(configureParameters):
8181
script.append("##export_var## CXX {}".format(_absolutize(ctx.workspace_name, tools.cxx)))
8282
if " " not in tools.cxx_linker_static:
8383
script.append("##export_var## AR {}".format(_absolutize(ctx.workspace_name, tools.cxx_linker_static)))
84+
if tools.strip and " " not in tools.strip:
85+
script.append("##export_var## STRIP {}".format(_absolutize(ctx.workspace_name, tools.strip)))
8486

8587
# set flags same as foreign_cc/private/cc_toolchain_util.bzl
8688
# cannot use get_flags_info() because bazel adds additional flags that

foreign_cc/private/cc_toolchain_util.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ CxxToolsInfo = provider(
2222
cxx_linker_static = "C++ linker to link static library",
2323
cxx_linker_executable = "C++ linker to link executable",
2424
ld = "linker",
25+
strip = "Binary symbol stripper",
2526
),
2627
)
2728

@@ -218,6 +219,13 @@ def get_tools_info(ctx):
218219
action_name = ACTION_NAMES.cpp_link_executable,
219220
),
220221
ld = cc_toolchain.ld_executable,
222+
strip = cc_common.get_tool_for_action(
223+
feature_configuration = feature_configuration,
224+
action_name = ACTION_NAMES.strip,
225+
) if cc_common.action_is_enabled(
226+
feature_configuration = feature_configuration,
227+
action_name = ACTION_NAMES.strip,
228+
) else "",
221229
)
222230

223231
def get_flags_info(ctx, link_output_file = None):

0 commit comments

Comments
 (0)