Skip to content

Commit f1d9361

Browse files
committed
meson: implement generated node support
1 parent 7617daf commit f1d9361

File tree

3 files changed

+69
-6
lines changed

3 files changed

+69
-6
lines changed

src/backend/nodes/meson.build

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
backend_sources += files(
22
'bitmapset.c',
3-
'copyfuncs.c',
4-
'equalfuncs.c',
53
'extensible.c',
64
'list.c',
75
'makefuncs.c',
86
'nodeFuncs.c',
97
'nodes.c',
10-
'outfuncs.c',
118
'params.c',
129
'print.c',
1310
'read.c',
14-
'readfuncs.c',
1511
'tidbitmap.c',
1612
'value.c',
1713
)
14+
15+
# these include .c files generated in ../../include/nodes, seems nicer to not
16+
# add that as an include path for the whole backend
17+
nodefunc_sources = files(
18+
'copyfuncs.c',
19+
'equalfuncs.c',
20+
'outfuncs.c',
21+
'readfuncs.c',
22+
)
23+
nodefuncs = static_library('nodefuncs',
24+
nodefunc_sources,
25+
c_pch: pch_c_h,
26+
dependencies: [backend_code],
27+
kwargs: default_lib_args + {'install': false},
28+
include_directories: include_directories('../../include/nodes'),
29+
)
30+
backend_link_with += nodefuncs

src/include/meson.build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ install_headers(
104104
install_dir: dir_include_server,
105105
)
106106

107-
subdir('utils')
108-
subdir('storage')
109107
subdir('catalog')
108+
subdir('nodes')
110109
subdir('parser')
111110
subdir('pch')
111+
subdir('storage')
112+
subdir('utils')
112113

113114
header_subdirs = [
114115
'access',

src/include/nodes/meson.build

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
node_support_input = [
2+
'nodes.h',
3+
'execnodes.h',
4+
'plannodes.h',
5+
'primnodes.h',
6+
'pathnodes.h',
7+
'extensible.h',
8+
'parsenodes.h',
9+
'replnodes.h',
10+
'value.h',
11+
'../commands/trigger.h',
12+
'../commands/event_trigger.h',
13+
'../foreign/fdwapi.h',
14+
'../access/amapi.h',
15+
'../access/tableam.h',
16+
'../access/tsmapi.h',
17+
'../utils/rel.h',
18+
'supportnodes.h',
19+
'../executor/tuptable.h',
20+
'lockoptions.h',
21+
'../access/sdir.h',
22+
]
23+
24+
node_support_output = [
25+
'nodetags.h',
26+
'outfuncs.funcs.c', 'outfuncs.switch.c',
27+
'readfuncs.funcs.c', 'readfuncs.switch.c',
28+
'copyfuncs.funcs.c', 'copyfuncs.switch.c',
29+
'equalfuncs.funcs.c', 'equalfuncs.switch.c',
30+
]
31+
node_support_install = [
32+
dir_include_server / 'nodes',
33+
false, false,
34+
false, false,
35+
false, false,
36+
false, false,
37+
]
38+
39+
generated_nodes = custom_target('scan',
40+
input: node_support_input,
41+
output: node_support_output,
42+
command: [
43+
perl, files('../../backend/nodes/gen_node_support.pl'),
44+
'-o', '@OUTDIR@',
45+
'@INPUT@'],
46+
install: true,
47+
install_dir: node_support_install,
48+
)
49+
generated_headers += generated_nodes[0]

0 commit comments

Comments
 (0)