Skip to content
This repository was archived by the owner on Jan 8, 2023. It is now read-only.

Commit 4dab3b9

Browse files
author
ApsarasX
committed
chore: update antlr version
1 parent b951b1b commit 4dab3b9

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
compiler:
2525
- { cc: gcc, cxx: g++ }
2626
- { cc: clang, cxx: clang++ }
27+
env:
28+
CC: ${{ matrix.compiler.cc }}
29+
CXX: ${{ matrix.compiler.cxx }}
2730
steps:
2831
- name: Fetch Codebase
2932
uses: actions/checkout@v2
@@ -32,7 +35,7 @@ jobs:
3235
uses: actions/cache@v2
3336
with:
3437
path: ${{ github.workspace }}/thirdparty
35-
key: ${{ matrix.os }}-${{ matrix.compiler.cc }}-antlr
38+
key: ${{ matrix.os }}-${{ matrix.compiler.cc }}-antlr4.9
3639
- name: Install Prerequirements
3740
run: |
3841
sudo wget https://apt.llvm.org/llvm.sh
@@ -41,30 +44,24 @@ jobs:
4144
sudo apt-get -y install uuid-dev pkg-config doxygen graphviz
4245
- name: Install Antlr4 and Antlr4 Runtime
4346
if: steps.cache-antlr.outputs.cache-hit != 'true'
44-
env:
45-
CC: ${{ matrix.compiler.cc }}
46-
CXX: ${{ matrix.compiler.cxx }}
4747
run: |
48-
echo "THREAD_COUNT=$(sudo cat /proc/cpuinfo| grep "processor"| wc -l)" >> $GITHUB_ENV
4948
sudo mkdir -p thirdparty/antlr && cd thirdparty/antlr
50-
sudo wget https://www.antlr.org/download/antlr-4.8-complete.jar
51-
sudo wget -O ${{ runner.temp }}/antlr4-src.zip https://www.antlr.org/download/antlr4-cpp-runtime-4.8-source.zip
49+
sudo wget https://www.antlr.org/download/antlr-4.9-complete.jar
50+
sudo wget -O ${{ runner.temp }}/antlr4-src.zip https://www.antlr.org/download/antlr4-cpp-runtime-4.9-source.zip
5251
cd ${{ runner.temp }}
5352
sudo unzip antlr4-src.zip
5453
sudo mkdir build && cd build
5554
sudo mkdir -p ${{ github.workspace }}/thirdparty/antlr-runtime
5655
sudo cmake .. -DANTLR4_INSTALL=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-w" -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/thirdparty/antlr-runtime
57-
sudo cmake --build . --target install -- -j $THREAD_COUNT
56+
sudo cmake --build . --target install -- -j 2
5857
- name: Move Antlr Runtime into /usr/local
5958
run: |
6059
cd ${{ github.workspace }}/thirdparty/antlr-runtime
6160
sudo cp -r include/* /usr/local/include/
6261
sudo cp -r lib/* /usr/local/lib/
6362
- name: CMake Build
64-
env:
65-
CC: ${{ matrix.compiler.cc }}
66-
CXX: ${{ matrix.compiler.cxx }}
6763
run: |
64+
echo "THREAD_COUNT=$(sudo cat /proc/cpuinfo| grep "processor"| wc -l)" >> $GITHUB_ENV
6865
sudo mkdir cmake-build-debug cmake-build-release
6966
cd cmake-build-debug
7067
sudo cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-w" -G "Unix Makefiles" ..
@@ -96,15 +93,15 @@ jobs:
9693
compiler:
9794
- { cc: gcc, cxx: g++ }
9895
- { cc: clang, cxx: clang++ }
96+
env:
97+
CC: ${{ matrix.compiler.cc }}
98+
CXX: ${{ matrix.compiler.cxx }}
9999
steps:
100100
- name: Install Prerequirements
101101
run: brew install antlr antlr4-cpp-runtime doxygen graphviz
102102
- name: Fetch Codebase
103103
uses: actions/checkout@v2
104104
- name: CMake Build
105-
env:
106-
CC: ${{ matrix.compiler.cc }}
107-
CXX: ${{ matrix.compiler.cxx }}
108105
run: |
109106
echo "THREAD_COUNT=$(sudo sysctl -n machdep.cpu.thread_count)" >> $GITHUB_ENV
110107
sudo mkdir cmake-build-debug cmake-build-release

cmake/AddANTLR.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
list(APPEND CMAKE_PREFIX_PATH /usr/local/lib/cmake/antlr4)
22

33
if (CMAKE_HOST_SYSTEM_NAME STREQUAL Linux)
4-
set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.8-complete.jar)
4+
set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.9-complete.jar)
55
elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
66
set(ANTLR4_JAR_LOCATION /usr/local/opt/antlr/antlr-4.9-complete.jar)
77
endif ()

0 commit comments

Comments
 (0)