1# Copyright (C) 2021 The Android Open Source Project 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# Constants for cc_* rules. 16# To use, load the constants struct: 17# 18# load("//build/bazel/rules:cc_constants.bzl", "constants") 19# Supported hdr extensions in Soong. Keep this consistent with hdrExts in build/soong/cc/snapshot_utils.go 20_HDR_EXTS = ["h", "hh", "hpp", "hxx", "h++", "inl", "inc", "ipp", "h.generic"] 21_C_SRC_EXTS = ["c"] 22_CPP_SRC_EXTS = ["cc", "cpp"] 23_AS_SRC_EXTS = ["s", "S"] 24_SRC_EXTS = _C_SRC_EXTS + _CPP_SRC_EXTS + _AS_SRC_EXTS 25_ALL_EXTS = _SRC_EXTS + _HDR_EXTS 26_HDR_EXTS_WITH_DOT = ["." + ext for ext in _HDR_EXTS] 27_SRC_EXTS_WITH_DOT = ["." + ext for ext in _SRC_EXTS] 28_ALL_EXTS_WITH_DOT = ["." + ext for ext in _ALL_EXTS] 29 30constants = struct( 31 hdr_exts = _HDR_EXTS, 32 c_src_exts = _C_SRC_EXTS, 33 cpp_src_exts = _CPP_SRC_EXTS, 34 as_src_exts = _AS_SRC_EXTS, 35 src_exts = _SRC_EXTS, 36 all_exts = _ALL_EXTS, 37 hdr_dot_exts = _HDR_EXTS_WITH_DOT, 38 src_dot_exts = _SRC_EXTS_WITH_DOT, 39 all_dot_exts = _ALL_EXTS_WITH_DOT, 40) 41