blob: 7f4a6f02d61fb158725355a7376bc88cb2da946a [file] [log] [blame]
# Constants for cc_* rules.
# To use, load the constants struct:
#
# load("//build/bazel/rules:cc_constants.bzl", "constants")
# Supported hdr extensions in Soong. Keep this consistent with hdrExts in build/soong/cc/snapshot_utils.go
_HDR_EXTS = ["h", "hh", "hpp", "hxx", "h++", "inl", "inc", "ipp", "h.generic"]
_C_SRC_EXTS = ["c"]
_CPP_SRC_EXTS = ["cc", "cpp"]
_AS_SRC_EXTS = ["S"]
_SRC_EXTS = _C_SRC_EXTS + _CPP_SRC_EXTS + _AS_SRC_EXTS
_ALL_EXTS = _SRC_EXTS + _HDR_EXTS
_HDR_EXTS_WITH_DOT = ["." + ext for ext in _HDR_EXTS]
_SRC_EXTS_WITH_DOT = ["." + ext for ext in _SRC_EXTS]
_ALL_EXTS_WITH_DOT = ["." + ext for ext in _ALL_EXTS]
# These are root-relative.
_GLOBAL_INCLUDE_DIRS_COPTS_ONLY_USED_FOR_SOONG_COMPATIBILITY_DO_NOT_ADD_MORE = [
"/",
]
constants = struct(
hdr_exts = _HDR_EXTS,
c_src_exts = _C_SRC_EXTS,
cpp_src_exts = _CPP_SRC_EXTS,
as_src_exts = _AS_SRC_EXTS,
src_exts = _SRC_EXTS,
all_exts = _ALL_EXTS,
hdr_dot_exts = _HDR_EXTS_WITH_DOT,
src_dot_exts = _SRC_EXTS_WITH_DOT,
all_dot_exts = _ALL_EXTS_WITH_DOT,
)