1# Copyright 2018 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"""Module extension for cc auto configuration.""" 15 16load("@bazel_features//:features.bzl", "bazel_features") 17load("//cc/private/toolchain:cc_configure.bzl", "cc_autoconf", "cc_autoconf_toolchains") 18 19def _cc_configure_extension_impl(ctx): 20 cc_autoconf_toolchains(name = "local_config_cc_toolchains") 21 cc_autoconf(name = "local_config_cc") 22 if bazel_features.external_deps.extension_metadata_has_reproducible: 23 return ctx.extension_metadata(reproducible = True) 24 else: 25 return None 26 27cc_configure_extension = module_extension(implementation = _cc_configure_extension_impl) 28