-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
40 lines (34 loc) · 1.02 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
project('ObjPgSQL', 'objc',
version: '1.0',
meson_version: '>= 1.5.0',
default_options: {
'warning_level': '3',
})
objfw_dep = dependency('objfw')
libpq_dep = dependency('libpq')
incdir = include_directories('src', 'src/exceptions')
subdir('src')
subdir('tests')
# Meson unfortunately does not allow access to the flags of libpq_dep.
pkgconfig = find_program('pkg-config')
libpq_cflags = run_command(
[pkgconfig, '--cflags', 'libpq'],
check: true).stdout().strip()
libpq_libs = run_command(
[pkgconfig, '--libs', 'libpq'],
check: true).stdout().strip()
objfwconfig = find_program('objfw-config')
packages_dir = run_command(
[objfwconfig, '--packages-dir'],
check: true).stdout().strip()
configure_file(
input: 'ObjPgSQL.oc.in',
output: 'ObjPgSQL.oc',
configuration: {
'includedir': get_option('prefix') / get_option('includedir'),
'libdir': get_option('prefix') / get_option('libdir'),
'LIBPQ_CPPFLAGS': libpq_cflags,
'LIBPQ_LIBS': libpq_libs,
},
install: true,
install_dir: packages_dir)