aboutsummaryrefslogtreecommitdiff
path: root/rules/cc_constants.bzl
blob: b86417cba022872be89105477c7df8a0142a2768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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"]
_SRC_EXTS = ["c", "cc", "cpp", "S"]
_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,
    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,
)