Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for bitcode generation on meson builds #103

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions contrib/amcheck/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ amcheck = shared_module('amcheck',
)
contrib_targets += amcheck

if llvm.found()
llvm_contrib_sources += {'amcheck': {'sources': amcheck_sources}}
endif

install_data(
'amcheck.control',
'amcheck--1.0.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/auth_delay/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ auth_delay = shared_module('auth_delay',
kwargs: contrib_mod_args,
)
contrib_targets += auth_delay
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and everywhere else: why only add it to contrib_tarets when llvm.found()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally removed, fixup: f26737a


if llvm.found()
llvm_contrib_sources += {'auth_delay': {'sources': auth_delay_sources}}
endif
4 changes: 4 additions & 0 deletions contrib/auto_explain/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ auto_explain = shared_module('auto_explain',
)
contrib_targets += auto_explain

if llvm.found()
llvm_contrib_sources += {'auto_explain': {'sources': auto_explain_sources}}
endif

tests += {
'name': 'auto_explain',
'sd': meson.current_source_dir(),
Expand Down
5 changes: 5 additions & 0 deletions contrib/basebackup_to_shell/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ basebackup_to_shell = shared_module('basebackup_to_shell',
)
contrib_targets += basebackup_to_shell

if llvm.found()
llvm_contrib_sources += {'basebackup_to_shell':
{'sources': basebackup_to_shell_sources}}
endif

tests += {
'name': 'basebackup_to_shell',
'sd': meson.current_source_dir(),
Expand Down
4 changes: 4 additions & 0 deletions contrib/basic_archive/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ basic_archive = shared_module('basic_archive',
)
contrib_targets += basic_archive

if llvm.found()
llvm_contrib_sources += {'basic_archive': {'sources': basic_archive_sources}}
endif

tests += {
'name': 'basic_archive',
'sd': meson.current_source_dir(),
Expand Down
5 changes: 5 additions & 0 deletions contrib/bloom/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ bloom = shared_module('bloom',
)
contrib_targets += bloom

if llvm.found()
llvm_contrib_sources += {'bloom': {'sources': bloom_sources}}
endif


install_data(
'bloom.control',
'bloom--1.0.sql',
Expand Down
16 changes: 16 additions & 0 deletions contrib/bool_plperl/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ bool_plperl = shared_module('bool_plperl',
)
contrib_targets += bool_plperl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you accidentally deleted this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's adjusted/fixed on the last commit e4cb123

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not as far as I can see.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, fixup that completely restores contrib_targets even when llvm.found() == false
f26737a


if llvm.found()
llvm_contrib_bool_plperl_cflags = [
'-I@0@/contrib/bool_plperl'.format(meson.build_root()),
'-I@0@/contrib/bool_plperl'.format(meson.source_root()),
'-I@0@/src/pl/plperl'.format(meson.build_root()),
'-I@0@/src/pl/plperl'.format(meson.source_root()),
]

llvm_contrib_sources += {
'bool_plperl': {
'sources': bool_plperl_sources,
'extra_args': llvm_contrib_bool_plperl_cflags + perl_ccflags,
}
}
endif

install_data(
'bool_plperl.control',
'bool_plperl--1.0.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/btree_gin/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ btree_gin = shared_module('btree_gin',
)
contrib_targets += btree_gin

if llvm.found()
llvm_contrib_sources += {'btree_gin': {'sources': btree_gin_sources}}
endif

install_data(
'btree_gin.control',
'btree_gin--1.0.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/btree_gist/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ btree_gist = shared_module('btree_gist',
)
contrib_targets += btree_gist

if llvm.found()
llvm_contrib_sources += {'btree_gist': {'sources': btree_gist_sources}}
endif

install_data(
'btree_gist.control',
'btree_gist--1.0--1.1.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/citext/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ citext = shared_module('citext',
)
contrib_targets += citext

if llvm.found()
llvm_contrib_sources += {'citext': {'sources': citext_sources}}
endif

install_data(
'citext.control',
'citext--1.0--1.1.sql',
Expand Down
18 changes: 18 additions & 0 deletions contrib/cube/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ cube_scan = custom_target('cubescan',
)
generated_sources += cube_scan
cube_sources += cube_scan
bc_cube_sources = cube_sources

cube_parse = custom_target('cubeparse',
input: 'cubeparse.y',
kwargs: bison_kw,
)
generated_sources += cube_parse.to_list()
cube_sources += cube_parse
bc_cube_sources += cube_parse[0]

if host_system == 'windows'
cube_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
Expand All @@ -32,6 +34,22 @@ cube = shared_module('cube',
)
contrib_targets += cube

if llvm.found()
llvm_contrib_cube_cflags = [
'-I@BUILD_ROOT@/contrib/cube',
'-I@SOURCE_ROOT@/contrib/cube',
]

llvm_gen_contrib_cube = generator(llvm_irgen_command,
arguments: llvm_irgen_args + bitcode_cflags + pg_mod_c_args + llvm_contrib_cube_cflags,
depends: cube,
depfile: '@[email protected]',
output: '@[email protected]',
)

bc_gen_sources_contrib += {'cube': llvm_gen_contrib_cube.process(bc_cube_sources)}
endif

install_data(
'cube.control',
'cube--1.0--1.1.sql',
Expand Down
13 changes: 13 additions & 0 deletions contrib/dblink/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ dblink = shared_module('dblink',
)
contrib_targets += dblink

if llvm.found()
llvm_contrib_dblink_cflags = [
'-I@0@/src/interfaces/libpq'.format(meson.source_root()),
]

llvm_contrib_sources += {
'dblink': {
'sources': dblink_sources,
'extra_args': llvm_contrib_dblink_cflags,
}
}
endif

install_data(
'dblink.control',
'dblink--1.0--1.1.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/dict_int/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ dict_int = shared_module('dict_int',
)
contrib_targets += dict_int

if llvm.found()
llvm_contrib_sources += {'dict_int': {'sources': dict_int_sources}}
endif

install_data(
'dict_int.control',
'dict_int--1.0.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/dict_xsyn/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ dict_xsyn = shared_module('dict_xsyn',
)
contrib_targets += dict_xsyn

if llvm.found()
llvm_contrib_sources += {'dict_xsyn': {'sources': dict_xsyn_sources}}
endif

install_data(
'dict_xsyn.control',
'dict_xsyn--1.0.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/earthdistance/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ earthdistance = shared_module('earthdistance',
)
contrib_targets += earthdistance

if llvm.found()
llvm_contrib_sources += {'earthdistance': {'sources': earthdistance_sources}}
endif

install_data(
'earthdistance.control',
'earthdistance--1.0--1.1.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/file_fdw/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ file_fdw = shared_module('file_fdw',
)
contrib_targets += file_fdw

if llvm.found()
llvm_contrib_sources += {'file_fdw': {'sources': file_fdw_sources}}
endif

install_data(
'file_fdw.control',
'file_fdw--1.0.sql',
Expand Down
15 changes: 15 additions & 0 deletions contrib/fuzzystrmatch/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ fuzzystrmatch_sources = files(
'fuzzystrmatch.c',
)

bc_fuzzystrmatch_sources = fuzzystrmatch_sources

daitch_mokotoff_h = custom_target('daitch_mokotoff',
input: 'daitch_mokotoff_header.pl',
output: 'daitch_mokotoff.h',
Expand All @@ -27,6 +29,19 @@ fuzzystrmatch = shared_module('fuzzystrmatch',
)
contrib_targets += fuzzystrmatch

if llvm.found()
llvm_contrib_fuzzystrmatch_cflags = [
'-I@0@/contrib/fuzzystrmatch'.format(meson.build_root()),
'-I@0@/contrib/fuzzystrmatch'.format(meson.source_root()),
]

llvm_contrib_sources += {
'fuzzystrmatch': {
'sources': bc_fuzzystrmatch_sources,
'extra_args': llvm_contrib_fuzzystrmatch_cflags,
}
}
endif
install_data(
'fuzzystrmatch.control',
'fuzzystrmatch--1.0--1.1.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/hstore/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ hstore = shared_module('hstore',
)
contrib_targets += hstore

if llvm.found()
llvm_contrib_sources += {'hstore': {'sources': hstore_sources}}
endif

install_data(
'hstore.control',
'hstore--1.1--1.2.sql',
Expand Down
16 changes: 16 additions & 0 deletions contrib/hstore_plperl/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ hstore_plperl = shared_module('hstore_plperl',
)
contrib_targets += hstore_plperl

if llvm.found()
llvm_contrib_hstore_plperl_cflags = [
'-I@0@/src/pl/plperl'.format(meson.build_root()),
'-I@0@/src/pl/plperl'.format(meson.source_root()),
'-I@0@/contrib'.format(meson.source_root()),
'-I@0@/contrib/hstore'.format(meson.source_root()),
]

llvm_contrib_sources += {
'hstore_plperl': {
'sources': hstore_plperl_sources,
'extra_args': llvm_contrib_hstore_plperl_cflags + perl_ccflags,
}
}
endif

install_data(
'hstore_plperl.control',
'hstore_plperl--1.0.sql',
Expand Down
19 changes: 19 additions & 0 deletions contrib/hstore_plpython/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ hstore_plpython = shared_module('hstore_plpython3',
)
contrib_targets += hstore_plpython

if llvm.found()
pyinc = python3_inst.get_variable('INCLUDEPY')
llvm_contrib_hstore_plpython_cflags = [
'-I@0@/src/pl/plpython'.format(meson.source_root()),
'-I@0@/contrib'.format(meson.source_root()),
'-I@0@/contrib/hstore'.format(meson.source_root()),
'-DPLPYTHON_LIBNAME="plpython3"',
'-I@0@'.format(pyinc),
]

llvm_contrib_sources += {
'hstore_plpython3': {
'sources': hstore_plpython_sources,
'extra_args': llvm_contrib_hstore_plpython_cflags,
}
}
endif


install_data(
'hstore_plpython3u--1.0.sql',
'hstore_plpython3u.control',
Expand Down
4 changes: 4 additions & 0 deletions contrib/intarray/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ intarray = shared_module('_int',
)
contrib_targets += intarray

if llvm.found()
llvm_contrib_sources += {'_int': {'sources': intarray_sources}}
endif

install_data(
'intarray.control',
'intarray--1.0--1.1.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/isn/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ isn = shared_module('isn',
)
contrib_targets += isn

if llvm.found()
llvm_contrib_sources += {'isn': {'sources': isn_sources}}
endif

install_data(
'isn.control',
'isn--1.0--1.1.sql',
Expand Down
15 changes: 15 additions & 0 deletions contrib/jsonb_plperl/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ jsonb_plperl = shared_module('jsonb_plperl',
)
contrib_targets += jsonb_plperl

if llvm.found()
llvm_contrib_jsonb_plperl_cflags = [
'-I@0@/src/pl/plperl'.format(meson.build_root()),
'-I@0@/src/pl/plperl'.format(meson.source_root()),
]

llvm_contrib_sources += {
'jsonb_plperl': {
'sources': jsonb_plperl_sources,
'extra_args': llvm_contrib_jsonb_plperl_cflags + perl_ccflags,
}
}
endif


install_data(
'jsonb_plperl.control',
'jsonb_plperl--1.0.sql',
Expand Down
18 changes: 18 additions & 0 deletions contrib/jsonb_plpython/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ jsonb_plpython = shared_module('jsonb_plpython3',
)
contrib_targets += jsonb_plpython

if llvm.found()
pyinc = python3_inst.get_variable('INCLUDEPY')
llvm_contrib_jsonb_plpython_cflags = [
'-I@0@/src/pl/plpython'.format(meson.source_root()),
'-I@0@/contrib'.format(meson.source_root()),
'-I@0@/contrib/hstore'.format(meson.source_root()),
'-DPLPYTHON_LIBNAME="plpython3"',
'-I@0@'.format(pyinc),
]

llvm_contrib_sources += {
'jsonb_plpython3': {
'sources': jsonb_plpython_sources,
'extra_args': llvm_contrib_jsonb_plpython_cflags,
}
}
endif

install_data(
'jsonb_plpython3u.control',
'jsonb_plpython3u--1.0.sql',
Expand Down
4 changes: 4 additions & 0 deletions contrib/lo/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ lo = shared_module('lo',
)
contrib_targets += lo

if llvm.found()
llvm_contrib_sources += {'lo': {'sources': lo_sources}}
endif

install_data(
'lo.control',
'lo--1.0--1.1.sql',
Expand Down
Loading