Skip to content

Commit

Permalink
fix(meson): rm use of locally installed antrl4
Browse files Browse the repository at this point in the history
* because meson check for version does not work
  • Loading branch information
Nic30 committed Jun 6, 2024
1 parent c4889ef commit 87abc58
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ RUN adduser --disabled-password \
${NB_USER}

RUN apt install build-essential uuid-dev cmake default-jre\
python3 python3-dev python3-pip libantlr4-runtime-dev\
antlr4 libssl-dev -yq
python3 python3-dev python3-pip libssl-dev -yq
RUN pip3 install scikit-build Cython notebook --break-system-packages
# RUN pip3 install hdlConvertor

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ It contains:
## Installation

Linux:
Installing dependencies (Ubuntu 20.10)
Installing dependencies (Ubuntu 24.04)
```
# gcc>=9, Visual Studio 2017 or equivalent recommended
sudo apt install build-essential uuid-dev cmake default-jre python3 python3-dev python3-pip libantlr4-runtime-dev antlr4 ninja-build
# gcc>=13, Visual Studio 2017 or equivalent recommended
sudo apt install build-essential uuid-dev cmake default-jre python3 python3-dev python3-pip ninja-build
```

Installing this library
Expand Down
21 changes: 11 additions & 10 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ elif host_machine.system() == 'linux'
EXTRA_CXX_FLAGS += ['-Wall', '-pedantic', '-W', '-Wno-attributes']
endif

antlr4_cpp_dep = cc.find_library('antlr4-runtime', required : false)
if not antlr4_cpp_dep.found()
# [fixme] use of local antlr4-runtime dissabled because check for version does not work
#antlr4_cpp_dep = cc.find_library('antlr4-runtime', required : false)
#if not antlr4_cpp_dep.found()
message('atempting to download antrl4-complete.jar and antlr4-runtime for C++ because installation was not found')
cmake = import('cmake')

Expand All @@ -40,7 +41,7 @@ if not antlr4_cpp_dep.found()
'ANTLR_BUILD_CPP_TESTS': false,
'ANTLR_BUILD_SHARED': false,
'ANTLR4_INSTALL': false,
'CMAKE_CXX_FLAGS': ' '.join(EXTRA_CXX_FLAGS + ['-Wno-overloaded-virtual']),
'CMAKE_CXX_FLAGS': ' '.join(EXTRA_CXX_FLAGS + ['-Wno-overloaded-virtual', '-Wno-unused-parameter']),
'CMAKE_POSITION_INDEPENDENT_CODE': true,
'CMAKE_BUILD_TYPE': 'Release',
})
Expand All @@ -55,13 +56,13 @@ if not antlr4_cpp_dep.found()
f'https://www.antlr.org/download/antlr-@[email protected]', antlr4_jar,
'--hash', 'md5', 'c9c8b566a7fcf8ef80e229f14b154a26', check: true)
antlr4_java = find_program('utils/antlr4-complete.sh') # an extra script so we do not need to write all arguments everytime
else
antlr4_cpp_inc = include_directories('/usr/include/antlr4-runtime/')
antlr4_cpp_dep = cc.find_library('antlr4-runtime', header_include_directories: antlr4_cpp_inc, has_headers: 'antlr4-runtime.h', required : false)
# redeclare because include_dir somehow is not in dependency
antlr4_cpp_dep = declare_dependency(dependencies: [antlr4_cpp_dep], include_directories: antlr4_cpp_inc)
antlr4_java = find_program('antlr4', required : true)
endif
#else
# antlr4_cpp_inc = include_directories('/usr/include/antlr4-runtime/')
# antlr4_cpp_dep = cc.find_library('antlr4-runtime', header_include_directories: antlr4_cpp_inc, has_headers: 'antlr4-runtime.h', required : false)
# # redeclare because include_dir somehow is not in dependency
# antlr4_cpp_dep = declare_dependency(dependencies: [antlr4_cpp_dep], include_directories: antlr4_cpp_inc)
# antlr4_java = find_program('antlr4', required : true)
#endif

cp = find_program('cp', required : true)

Expand Down

0 comments on commit 87abc58

Please sign in to comment.