blob: 4c822435bef333a9eab4686030aa3fa0308e63cf [file] [log] [blame]
# This file will be copied into //third_party/externals/expat via the new_local_repository
# rule in WORKSPACE.bazel, so all files should be relative to that path.
genrule(
name = "copy_config_override",
srcs = [
"@expat_config//:expat_config.h",
],
outs = [
# Putting this in the root of the expat directory makes it easiest to include.
"include/expat_config.h",
],
# $< is the one and only input file.
# $@ is the one and only output location.
cmd = "cp $< $@",
)
EXPAT_HDRS = [
"expat/lib/expat.h",
]
EXPAT_SRCS = [
"expat/lib/ascii.h",
"expat/lib/asciitab.h",
"expat/lib/expat.h",
"expat/lib/expat_external.h",
"expat/lib/iasciitab.h",
"expat/lib/internal.h",
"expat/lib/latin1tab.h",
"expat/lib/nametab.h",
"expat/lib/siphash.h",
"expat/lib/utf8tab.h",
"expat/lib/winconfig.h",
"expat/lib/xmlparse.c",
"expat/lib/xmlrole.c",
"expat/lib/xmlrole.h",
"expat/lib/xmltok.c",
"expat/lib/xmltok.h",
"expat/lib/xmltok_impl.h",
# Our generated configuration file
"include/expat_config.h",
]
TEXTUAL_HDRS = [
"expat/lib/xmltok_impl.c",
"expat/lib/xmltok_ns.c",
]
cc_library(
name = "expat",
srcs = EXPAT_SRCS,
hdrs = EXPAT_HDRS,
# EXPAT_FMT_PTRDIFF_T uses outdated format specifiers
copts = ["-Wno-format"],
defines = [
"XML_STATIC",
],
includes = [
"expat/lib",
"include",
],
textual_hdrs = TEXTUAL_HDRS,
visibility = ["//visibility:public"],
)