blob: 83207ea4f2cb9cd60640d7686d15180283a6a2ba [file] [log] [blame]
Tim Windelschmidt16cb15a2025-02-24 18:47:48 +01001load("@rules_cc//cc:defs.bzl", "cc_library")
2
Serge Bazanski46e72ab2022-09-05 15:13:22 +02003filegroup(
4 name = "all",
5 srcs = glob(["**"]),
6 visibility = ["//visibility:public"],
7)
8
9cc_library(
10 name = "libpg_query",
11 srcs = glob([
12 "src/*.c",
13 "src/*.h",
Serge Bazanski46e72ab2022-09-05 15:13:22 +020014 "src/postgres/include/*.h",
15 "src/postgres/include/**/*.h",
16 ], [
17 "src/pg_query_enum_defs.c",
18 "src/pg_query_fingerprint_defs.c",
19 "src/pg_query_fingerprint_conds.c",
20 "src/pg_query_outfuncs_defs.c",
21 "src/pg_query_outfuncs_conds.c",
22 "src/pg_query_readfuncs_defs.c",
23 "src/pg_query_readfuncs_conds.c",
24 "src/pg_query_json_helper.c",
Tim Windelschmidte4895292025-02-04 03:10:39 +010025 ]) + [
26 "vendor/protobuf-c/protobuf-c.h",
27 "vendor/protobuf-c/protobuf-c.c",
28 "vendor/xxhash/xxhash.c",
29 "protobuf/pg_query.pb-c.c",
30 "protobuf/pg_query.pb-c.h",
31 ],
Serge Bazanski46e72ab2022-09-05 15:13:22 +020032 textual_hdrs = [
33 "src/pg_query_enum_defs.c",
34 "src/pg_query_fingerprint_defs.c",
35 "src/pg_query_fingerprint_conds.c",
36 "src/pg_query_outfuncs_defs.c",
37 "src/pg_query_outfuncs_conds.c",
38 "src/pg_query_readfuncs_defs.c",
39 "src/pg_query_readfuncs_conds.c",
40 "src/pg_query_json_helper.c",
41 ],
42 hdrs = [
43 "pg_query.h",
44 "vendor/xxhash/xxhash.h",
45 ],
46 # Unfortunate. We should patch this library so that this doesn't pollute
47 # all dependents.
48 includes = [
49 "vendor/xxhash",
50 "src/postgres/include",
51 "vendor",
52 "vendor/protobuf-c",
53 "src",
54 ],
55 copts = [
56 "-Iexternal/libpg_query/protobuf",
57 "-Iexternal/libpg_query/vendor/xxhash",
58 ],
59 visibility = [
Tim Windelschmidt8fd51cd2025-06-29 02:20:17 +020060 "//visibility:public",
Serge Bazanski46e72ab2022-09-05 15:13:22 +020061 ],
62)