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    "@bazel_tools//tools/cpp: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 = "nm", path = "/bin/false"),
53        tool_path(name = "objcopy", path = "/bin/false"),
54        tool_path(name = "objdump", path = "/bin/false"),
55        tool_path(name = "strip", path = "/bin/false"),
56    ]
57
58    return cc_common.create_cc_toolchain_config_info(
59        ctx = ctx,
60        features = features,
61        action_configs = action_configs,
62        artifact_name_patterns = artifact_name_patterns,
63        cxx_builtin_include_directories = cxx_builtin_include_directories,
64        toolchain_identifier = toolchain_identifier,
65        host_system_name = host_system_name,
66        target_system_name = target_system_name,
67        target_cpu = target_cpu,
68        target_libc = target_libc,
69        compiler = compiler,
70        abi_version = abi_version,
71        abi_libc_version = abi_libc_version,
72        tool_paths = tool_paths,
73        make_variables = make_variables,
74        builtin_sysroot = builtin_sysroot,
75        cc_target_os = cc_target_os,
76    )
77
78armeabi_cc_toolchain_config = rule(
79    implementation = _impl,
80    attrs = {},
81    provides = [CcToolchainConfigInfo],
82)
83