To circumvent this issue, this commit adds a new attribute called tools to
the native_tool_toolchain rule. Through this attribute, extra targets
can be passed to _resolve_tool_path in order to be able to expand the path
to a single file using $(execpath).
Fix #1161: set the
CMAKE
environment variables for prebuilt toolchains.This commit is an attempt to fix #1161 by setting the
CMAKE
environment variable (throughTemplateVariableInfo
).Since the CMake prebuilt packages yield multiple files, we cannot use
$(execpath)
to get the path to the CMake binary, as we do for Ninja:https://github.com/bazelbuild/rules_foreign_cc/blob/c2e097455d2bbf92b2ae71611d1261ba79eb8aa8/toolchains/prebuilt_toolchains.py#L449
To circumvent this issue, this commit adds a new attribute called
tools
to thenative_tool_toolchain
rule. Through this attribute, extra targets can be passed to_resolve_tool_path
in order to be able to expand the path to a single file using$(execpath)
.