Skip to content

Commit 36add6e

Browse files
authored
Merge pull request #204 from Thomasb81/fix_202
Fix #202 (missing deps on generated files in meson)
2 parents 7de6dd1 + d0fd128 commit 36add6e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ mainIncludeDir = 'include/'
8989
mainIncludeDir_inc = include_directories(mainIncludeDir)
9090
all_parser_libs = []
9191
all_parser_deps = []
92+
all_parser_header_targets = []
93+
9294
foreach parserTuple : ANTLR_PARSERS
9395
name = parserTuple[0]
9496
folder_name = parserTuple[1]
@@ -147,7 +149,11 @@ foreach parserTuple : ANTLR_PARSERS
147149
endif
148150
endforeach
149151
genIncludeDir = join_paths('include', 'hdlConvertor', folder_name, f'@name@Parser')
150-
subdir(genIncludeDir)
152+
subdir(genIncludeDir)
153+
154+
# Add the header copy target to our list of dependencies
155+
all_parser_header_targets += antrl_parser_headers
156+
151157
parser_cpp_src = run_command(python_prog, 'utils/rec_glob.py', join_paths('src', folder_name), '*.cpp', check:true)\
152158
.stdout().strip().split('\n')
153159

src/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ hdlConvertor_core_src += run_command(py3, '../utils/rec_glob.py', './baseHdlPars
1515
.stdout().strip().split('\n')
1616

1717
hdlConvertor_core_static_lib = static_library('hdlConvertor_core_static',
18-
hdlConvertor_core_src,
18+
hdlConvertor_core_src + all_parser_header_targets,
1919
cpp_args: EXTRA_CXX_FLAGS,
2020
dependencies: [antlr4_cpp_dep, all_parser_deps],
2121
include_directories: [mainIncludeDir_inc],
@@ -32,7 +32,7 @@ if get_option('python_package')
3232
# [note] hdlConvertor_core_static and hdlConvertor_cpp_static has to be separated
3333
# otherwise it is not possible to link this library
3434
hdlConvertor_cpp_static = static_library('hdlConvertor_cpp_static',
35-
hdlConvertor_cpp_src,
35+
hdlConvertor_cpp_src + all_parser_header_targets,
3636
cpp_args: EXTRA_CXX_FLAGS,
3737
dependencies: [antlr4_cpp_dep, all_parser_deps],
3838
include_directories: [mainIncludeDir_inc],
@@ -42,7 +42,7 @@ if get_option('python_package')
4242
else
4343
# add dummy file to make cmake happy
4444
hdlConvertor_cpp_shared = shared_library('hdlConvertor_cpp_shared',
45-
hdlConvertor_cpp_src,
45+
hdlConvertor_cpp_src + all_parser_header_targets,
4646
cpp_args: EXTRA_CXX_FLAGS,
4747
dependencies: [antlr4_cpp_dep, ] + all_parser_deps,
4848
include_directories: [mainIncludeDir_inc],

0 commit comments

Comments
 (0)