forked from postgres/postgres
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmeson.build
40 lines (36 loc) · 1.18 KB
/
meson.build
1
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
#
# emit LLVM bitcode for JIT inlining
assert(llvm.found())
foreach bitcode_module : bitcode_modules
bitcode_targets = []
bitcode_obj = bitcode_module['target']
if 'name' not in bitcode_module
bitcode_name = bitcode_obj.name()
else
bitcode_name = bitcode_module['name']
endif
foreach srcfile : bitcode_module['srcfiles']
srcfilename = '@0@'.format(srcfile)
targetname = '@0@_@1@_@[email protected]'.format(
bitcode_name,
fs.parent(srcfilename).underscorify(), fs.name(srcfilename))
bitcode_targets += custom_target(
targetname,
input: [srcfile, bitcode_obj.extract_objects(srcfile)],
output: targetname,
command: [llvm_irgen_command, bitcode_cflags],
install: true,
install_dir: dir_bitcode,
)
endforeach
index_name = '@[email protected]'.format(bitcode_name)
bitcode_index = custom_target('@0@'.format(bitcode_name),
output: index_name,
input: bitcode_targets,
command: [irlink, '--lto', llvm_lto, '--outdir', '@OUTDIR@', '--index', index_name, '@INPUT@'],
install: true,
install_dir: dir_bitcode,
)
backend_targets += bitcode_index
endforeach