• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This file will be copied into //third_party/externals/expat via the new_local_repository
2# rule in WORKSPACE.bazel, so all files should be relative to that path.
3
4genrule(
5    name = "copy_config_override",
6    srcs = [
7        "@expat_config//:expat_config/expat_config.h",
8    ],
9    outs = [
10        # Putting this in the root of the expat directory makes it easiest to include.
11        "include/expat_config.h",
12    ],
13    # $< is the one and only input file.
14    # $@ is the one and only output location.
15    cmd = "cp $< $@",
16    cmd_bat = "copy $< $@",
17)
18
19EXPAT_HDRS = [
20    "expat/lib/expat.h",
21]
22
23EXPAT_SRCS = [
24    "expat/lib/ascii.h",
25    "expat/lib/asciitab.h",
26    "expat/lib/expat.h",
27    "expat/lib/expat_external.h",
28    "expat/lib/iasciitab.h",
29    "expat/lib/internal.h",
30    "expat/lib/latin1tab.h",
31    "expat/lib/nametab.h",
32    "expat/lib/siphash.h",
33    "expat/lib/utf8tab.h",
34    "expat/lib/winconfig.h",
35    "expat/lib/xmlparse.c",
36    "expat/lib/xmlrole.c",
37    "expat/lib/xmlrole.h",
38    "expat/lib/xmltok.c",
39    "expat/lib/xmltok.h",
40    "expat/lib/xmltok_impl.h",
41    # Our generated configuration file
42    "include/expat_config.h",
43]
44
45TEXTUAL_HDRS = [
46    "expat/lib/xmltok_impl.c",
47    "expat/lib/xmltok_ns.c",
48]
49
50cc_library(
51    name = "expat",
52    srcs = EXPAT_SRCS,
53    hdrs = EXPAT_HDRS,
54    # EXPAT_FMT_PTRDIFF_T uses outdated format specifiers
55    copts = ["-Wno-format"],
56    defines = [
57        "XML_STATIC",
58    ],
59    includes = [
60        "expat/lib",
61        "include",
62    ],
63    textual_hdrs = TEXTUAL_HDRS,
64    visibility = ["//visibility:public"],
65)
66