Skip to content

Commit 89b48f2

Browse files
Internal change
PiperOrigin-RevId: 922858741
1 parent bd6151f commit 89b48f2

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

MODULE.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ bazel_dep(name = "rules_python", version = "1.9.0")
5050
# antlr4-cpp-runtime/VERSION and the system `#include <version>`
5151
single_version_override(
5252
module_name = "antlr4-cpp-runtime",
53-
patch_cmds = [
54-
"python3 -c \"import os; [os.rename(f, f + '.txt') for f in ['VERSION', 'version'] if os.path.exists(f)]\" || python -c \"import os; [os.rename(f, f + '.txt') for f in ['VERSION', 'version'] if os.path.exists(f)]\"",
55-
],
53+
patches = ["//bazel:antlr.patch"],
5654
)
5755

5856
# Configure rules_python's hermetic toolchains to resolve external

bazel/antlr.patch

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--- BUILD.bazel
2+
+++ BUILD.bazel
3+
@@ -17,21 +17,21 @@
4+
cc_library(
5+
name = "antlr4-cpp-runtime",
6+
srcs = glob(["runtime/src/**/*.cpp"]),
7+
hdrs = ["runtime/src/antlr4-runtime.h"],
8+
copts = ["-fexceptions"],
9+
- defines = ["ANTLR4CPP_USING_ABSEIL"],
10+
+ defines = ["ANTLR4CPP_USING_ABSEIL", "ANTLR4CPP_STATIC"],
11+
features = ["-use_header_modules"],
12+
includes = ["runtime/src"],
13+
textual_hdrs = glob(
14+
["runtime/src/**/*.h"],
15+
exclude = ["runtime/src/antlr4-runtime.h"],
16+
),
17+
visibility = ["//visibility:public"],
18+
deps = [
19+
"@com_google_absl//absl/base",
20+
"@com_google_absl//absl/base:core_headers",
21+
"@com_google_absl//absl/container:flat_hash_map",
22+
"@com_google_absl//absl/container:flat_hash_set",
23+
"@com_google_absl//absl/synchronization",
24+
],
25+
)
26+
27+
--- VERSION
28+
+++ /dev/null
29+
@@ -1,1 +1,0 @@
30+
-4.13.2

0 commit comments

Comments
 (0)