diff --git a/foreign_cc/meson.bzl b/foreign_cc/meson.bzl index 8fb547bf..e935a475 100644 --- a/foreign_cc/meson.bzl +++ b/foreign_cc/meson.bzl @@ -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 diff --git a/foreign_cc/private/cc_toolchain_util.bzl b/foreign_cc/private/cc_toolchain_util.bzl index 3b15578e..6aa10b50 100644 --- a/foreign_cc/private/cc_toolchain_util.bzl +++ b/foreign_cc/private/cc_toolchain_util.bzl @@ -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", ), ) @@ -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):