1""" 2Copyright (C) 2021 The Android Open Source Project 3 4Licensed under the Apache License, Version 2.0 (the "License"); 5you may not use this file except in compliance with the License. 6You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10Unless required by applicable law or agreed to in writing, software 11distributed under the License is distributed on an "AS IS" BASIS, 12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13See the License for the specific language governing permissions and 14limitations under the License. 15""" 16 17# Constants for cc_* rules. 18# To use, load the constants struct: 19# 20# load("//build/bazel/rules:cc_constants.bzl", "constants") 21# Supported hdr extensions in Soong. Keep this consistent with hdrExts in build/soong/cc/snapshot_utils.go 22_HDR_EXTS = ["h", "hh", "hpp", "hxx", "h++", "inl", "inc", "ipp", "h.generic"] 23_C_SRC_EXTS = ["c"] 24_CPP_SRC_EXTS = ["cc", "cpp"] 25_AS_SRC_EXTS = ["S"] 26_SRC_EXTS = _C_SRC_EXTS + _CPP_SRC_EXTS + _AS_SRC_EXTS 27_ALL_EXTS = _SRC_EXTS + _HDR_EXTS 28_HDR_EXTS_WITH_DOT = ["." + ext for ext in _HDR_EXTS] 29_SRC_EXTS_WITH_DOT = ["." + ext for ext in _SRC_EXTS] 30_ALL_EXTS_WITH_DOT = ["." + ext for ext in _ALL_EXTS] 31 32# These are root-relative. 33_GLOBAL_INCLUDE_DIRS_COPTS_ONLY_USED_FOR_SOONG_COMPATIBILITY_DO_NOT_ADD_MORE = [ 34 "/", 35] 36constants = struct( 37 hdr_exts = _HDR_EXTS, 38 c_src_exts = _C_SRC_EXTS, 39 cpp_src_exts = _CPP_SRC_EXTS, 40 as_src_exts = _AS_SRC_EXTS, 41 src_exts = _SRC_EXTS, 42 all_exts = _ALL_EXTS, 43 hdr_dot_exts = _HDR_EXTS_WITH_DOT, 44 src_dot_exts = _SRC_EXTS_WITH_DOT, 45 all_dot_exts = _ALL_EXTS_WITH_DOT, 46) 47