Skip to content

Commit d5a4cdb

Browse files
committed
Configure STRIP tool for meson
1 parent 48632c7 commit d5a4cdb

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
@@ -83,6 +83,8 @@ def _create_meson_script(configureParameters):
8383
script.append("##export_var## CXX {}".format(_absolutize(ctx.workspace_name, tools.cxx)))
8484
if " " not in tools.cxx_linker_static:
8585
script.append("##export_var## AR {}".format(_absolutize(ctx.workspace_name, tools.cxx_linker_static)))
86+
if tools.strip and " " not in tools.strip:
87+
script.append("##export_var## STRIP {}".format(_absolutize(ctx.workspace_name, tools.strip)))
8688

8789
copts = flags.cc
8890
cxxopts = flags.cxx

foreign_cc/private/cc_toolchain_util.bzl

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

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

224232
def get_flags_info(ctx, link_output_file = None):

0 commit comments

Comments
 (0)