blob: 1a2486b118a54a382431686b366ab0181293587f [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",
Serge Bazanski46e72ab2022-09-05 15:13:22 +020012 "src/postgres/include/*.h",
13 "src/postgres/include/**/*.h",
14 ], [
15 "src/pg_query_enum_defs.c",
16 "src/pg_query_fingerprint_defs.c",
17 "src/pg_query_fingerprint_conds.c",
18 "src/pg_query_outfuncs_defs.c",
19 "src/pg_query_outfuncs_conds.c",
20 "src/pg_query_readfuncs_defs.c",
21 "src/pg_query_readfuncs_conds.c",
22 "src/pg_query_json_helper.c",
Tim Windelschmidte4895292025-02-04 03:10:39 +010023 ]) + [
24 "vendor/protobuf-c/protobuf-c.h",
25 "vendor/protobuf-c/protobuf-c.c",
26 "vendor/xxhash/xxhash.c",
27 "protobuf/pg_query.pb-c.c",
28 "protobuf/pg_query.pb-c.h",
29 ],
Serge Bazanski46e72ab2022-09-05 15:13:22 +020030 textual_hdrs = [
31 "src/pg_query_enum_defs.c",
32 "src/pg_query_fingerprint_defs.c",
33 "src/pg_query_fingerprint_conds.c",
34 "src/pg_query_outfuncs_defs.c",
35 "src/pg_query_outfuncs_conds.c",
36 "src/pg_query_readfuncs_defs.c",
37 "src/pg_query_readfuncs_conds.c",
38 "src/pg_query_json_helper.c",
39 ],
40 hdrs = [
41 "pg_query.h",
42 "vendor/xxhash/xxhash.h",
43 ],
44 # Unfortunate. We should patch this library so that this doesn't pollute
45 # all dependents.
46 includes = [
47 "vendor/xxhash",
48 "src/postgres/include",
49 "vendor",
50 "vendor/protobuf-c",
51 "src",
52 ],
53 copts = [
54 "-Iexternal/libpg_query/protobuf",
55 "-Iexternal/libpg_query/vendor/xxhash",
56 ],
57 visibility = [
Tim Windelschmidt745bf6d2024-07-17 21:43:41 +020058 "@//third_party/libpg_query:__pkg__",
Serge Bazanski46e72ab2022-09-05 15:13:22 +020059 ],
60)