Commit 40212a2
Move ANTLR4 dependency inclusion to top-level CMakeLists.txt (#127)
MSVC has a hard 260 character limit which (unfortunately) isn't
immediately fixable (note: this is independent of the "infamous" Windows
path length limit).
`substrait-cpp` can become an issue when it itself is being used as a
dependency of other projects ([see e.g. this
discussion](substrait-io/substrait-mlir-contrib#92 (comment)).
Here, it's the `antlr4` build that's generating the longest paths, e.g.:
>
`substrait-cpp/src/substrait/textplan/parser/grammar/antlr4_runtime/src/antlr4_runtime/runtime/Cpp/CMakeFiles/CMakeScratch/TryCompile-s3o9if/CMakeFiles/cmTC_945a8.dir/./`
To give ourselves a bit of breathing room here,
`src/substrait/textplan/parser/grammar` seems fairly unnecessary, and is
simply a side-effect of `include(ExternalAntlr4Cpp)` being called at
that nested location.
This PR moves that inclusion up to the top-level, giving MSVC builds an
extra 38 characters to work with 🙂.
Another possible work around could be to rewrite the ANTLR4 dependency
management s.t. `FetchContent` is used to manage the build.
This would mean that the dependency would be built in e.g. the root
`build/_deps/antlr4` location, irrespective of any git submodule
nesting.
* Also allows setting `ANTLR_BUILD_CPP_TESTS` for the ANTLR build
(avoids ANTLR pulling in gtest which may conflict with other things when
`substrait-cpp` is a dependency of other projects).
* Removes the assumption that antlr libraries are located in the `dist`
folder within the ANTLR checked-out source hierarchy (we're doing an
in-source build). AFAICT, [this behavior places a hard assumption on
`ANTLR_BUILD_CPP_TESTS` being
set](https://github.com/antlr/antlr4/blob/dev/runtime/Cpp/runtime/CMakeLists.txt#L159-L177)
which is what triggers the behaviour for copying binaries to the `dist`
folder.
---------
Co-authored-by: David Sisson <[email protected]>1 parent 5d05a2b commit 40212a2
File tree
4 files changed
+27
-27
lines changed- scripts
- src/substrait/textplan/parser/grammar
- third_party/antlr4/cmake
4 files changed
+27
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
34 | 54 | | |
35 | 55 | | |
36 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 3 | | |
27 | 4 | | |
28 | 5 | | |
| |||
53 | 30 | | |
54 | 31 | | |
55 | 32 | | |
| 33 | + | |
56 | 34 | | |
57 | 35 | | |
58 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
0 commit comments