1# Copyright 2023 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"""Fake for providing CcToolchainConfigInfo.""" 16 17def _impl(ctx): 18 return cc_common.create_cc_toolchain_config_info( 19 ctx = ctx, 20 toolchain_identifier = ctx.attr.toolchain_identifier, 21 host_system_name = "local", 22 target_system_name = "local", 23 target_cpu = ctx.attr.target_cpu, 24 target_libc = "unknown", 25 compiler = "clang", 26 abi_version = "unknown", 27 abi_libc_version = "unknown", 28 ) 29 30fake_cc_toolchain_config = rule( 31 implementation = _impl, 32 attrs = { 33 "target_cpu": attr.string(), 34 "toolchain_identifier": attr.string(), 35 }, 36 provides = [CcToolchainConfigInfo], 37) 38