blob: c0f98a7fd19687d5fc1e60f90ed5a48012636c8a [file] [log] [blame]
Serge Bazanski46e72ab2022-09-05 15:13:22 +02001filegroup(
2 name = "all",
3 srcs = glob(["**"]),
4 visibility = ["//visibility:public"],
5)
6
7cc_library(
8 name = "libpg_query",
9 srcs = glob([
10 "src/*.c",
11 "src/*.h",
12
13 "vendor/protobuf-c/protobuf-c.h",
14 "vendor/protobuf-c/protobuf-c.c",
15
16 "vendor/xxhash/xxhash.c",
17
18 "protobuf/pg_query.pb-c.c",
19 "protobuf/pg_query.pb-c.h",
20
21 "src/postgres/include/*.h",
22 "src/postgres/include/**/*.h",
23 ], [
24 "src/pg_query_enum_defs.c",
25 "src/pg_query_fingerprint_defs.c",
26 "src/pg_query_fingerprint_conds.c",
27 "src/pg_query_outfuncs_defs.c",
28 "src/pg_query_outfuncs_conds.c",
29 "src/pg_query_readfuncs_defs.c",
30 "src/pg_query_readfuncs_conds.c",
31 "src/pg_query_json_helper.c",
32 ]),
33 textual_hdrs = [
34 "src/pg_query_enum_defs.c",
35 "src/pg_query_fingerprint_defs.c",
36 "src/pg_query_fingerprint_conds.c",
37 "src/pg_query_outfuncs_defs.c",
38 "src/pg_query_outfuncs_conds.c",
39 "src/pg_query_readfuncs_defs.c",
40 "src/pg_query_readfuncs_conds.c",
41 "src/pg_query_json_helper.c",
42 ],
43 hdrs = [
44 "pg_query.h",
45 "vendor/xxhash/xxhash.h",
46 ],
47 # Unfortunate. We should patch this library so that this doesn't pollute
48 # all dependents.
49 includes = [
50 "vendor/xxhash",
51 "src/postgres/include",
52 "vendor",
53 "vendor/protobuf-c",
54 "src",
55 ],
56 copts = [
57 "-Iexternal/libpg_query/protobuf",
58 "-Iexternal/libpg_query/vendor/xxhash",
59 ],
60 visibility = [
61 "@com_github_pganalyze_pg_query_go_v2//:__subpackages__",
62 ],
63)