forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdummy_cc_toolchain.bzl
More file actions
28 lines (25 loc) · 977 Bytes
/
dummy_cc_toolchain.bzl
File metadata and controls
28 lines (25 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
This file defines a dummy C++ toolchain for Windows.
It is needed to satisfy Bazel's toolchain resolution when cross-compiling for Windows on Linux.
Some rules (e.g. rules_nodejs, js_test) or their dependencies may trigger C++ toolchain resolution
even if no actual C++ compilation is performed for the target platform.
Without this, the build fails with "Unable to find a CC toolchain using toolchain resolution".
"""
load("@rules_cc//cc:defs.bzl", "cc_common")
def _impl(ctx):
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
toolchain_identifier = "dummy-toolchain",
host_system_name = "local",
target_system_name = "local",
target_cpu = "x64_windows",
target_libc = "unknown",
compiler = "dummy",
abi_version = "unknown",
abi_libc_version = "unknown",
)
dummy_cc_toolchain_config = rule(
implementation = _impl,
attrs = {},
provides = [CcToolchainConfigInfo],
)