| Tim Windelschmidt | 16cb15a | 2025-02-24 18:47:48 +0100 | [diff] [blame] | 1 | load("@rules_cc//cc:defs.bzl", "cc_library") |
| 2 | |
| Serge Bazanski | 46e72ab | 2022-09-05 15:13:22 +0200 | [diff] [blame] | 3 | filegroup( |
| 4 | name = "all", |
| 5 | srcs = glob(["**"]), |
| 6 | visibility = ["//visibility:public"], |
| 7 | ) |
| 8 | |
| 9 | cc_library( |
| 10 | name = "libpg_query", |
| 11 | srcs = glob([ |
| 12 | "src/*.c", |
| 13 | "src/*.h", |
| Serge Bazanski | 46e72ab | 2022-09-05 15:13:22 +0200 | [diff] [blame] | 14 | "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 Windelschmidt | e489529 | 2025-02-04 03:10:39 +0100 | [diff] [blame] | 25 | ]) + [ |
| 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 Bazanski | 46e72ab | 2022-09-05 15:13:22 +0200 | [diff] [blame] | 32 | 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 Windelschmidt | 745bf6d | 2024-07-17 21:43:41 +0200 | [diff] [blame] | 60 | "@//third_party/libpg_query:__pkg__", |
| Serge Bazanski | 46e72ab | 2022-09-05 15:13:22 +0200 | [diff] [blame] | 61 | ], |
| 62 | ) |