• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#    http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""A Starlark cc_toolchain configuration rule"""
16
17load(
18    "@rules_cc//cc:cc_toolchain_config_lib.bzl",
19    "feature",
20    "tool_path",
21)
22
23def _impl(ctx):
24    toolchain_identifier = "stub_armeabi-v7a"
25    host_system_name = "armeabi-v7a"
26    target_system_name = "armeabi-v7a"
27    target_cpu = "armeabi-v7a"
28    target_libc = "armeabi-v7a"
29    compiler = "compiler"
30    abi_version = "armeabi-v7a"
31    abi_libc_version = "armeabi-v7a"
32    cc_target_os = None
33    builtin_sysroot = None
34    action_configs = []
35
36    supports_pic_feature = feature(name = "supports_pic", enabled = True)
37    supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
38    features = [supports_dynamic_linker_feature, supports_pic_feature]
39
40    cxx_builtin_include_directories = []
41    artifact_name_patterns = []
42    make_variables = []
43
44    tool_paths = [
45        tool_path(name = "ar", path = "/bin/false"),
46        tool_path(name = "compat-ld", path = "/bin/false"),
47        tool_path(name = "cpp", path = "/bin/false"),
48        tool_path(name = "dwp", path = "/bin/false"),
49        tool_path(name = "gcc", path = "/bin/false"),
50        tool_path(name = "gcov", path = "/bin/false"),
51        tool_path(name = "ld", path = "/bin/false"),
52        tool_path(name = "llvm-profdata", path = "/bin/false"),
53        tool_path(name = "nm", path = "/bin/false"),
54        tool_path(name = "objcopy", path = "/bin/false"),
55        tool_path(name = "objdump", path = "/bin/false"),
56        tool_path(name = "strip", path = "/bin/false"),
57    ]
58
59    return cc_common.create_cc_toolchain_config_info(
60        ctx = ctx,
61        features = features,
62        action_configs = action_configs,
63        artifact_name_patterns = artifact_name_patterns,
64        cxx_builtin_include_directories = cxx_builtin_include_directories,
65        toolchain_identifier = toolchain_identifier,
66        host_system_name = host_system_name,
67        target_system_name = target_system_name,
68        target_cpu = target_cpu,
69        target_libc = target_libc,
70        compiler = compiler,
71        abi_version = abi_version,
72        abi_libc_version = abi_libc_version,
73        tool_paths = tool_paths,
74        make_variables = make_variables,
75        builtin_sysroot = builtin_sysroot,
76        cc_target_os = cc_target_os,
77    )
78
79armeabi_cc_toolchain_config = rule(
80    implementation = _impl,
81    attrs = {},
82    provides = [CcToolchainConfigInfo],
83)
84