forked from dequis/purple-facebook
-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
72 lines (61 loc) · 3.06 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
project('purple-facebook', 'c')
compiler_options = []
compiler_options += ['-DPACKAGE_VERSION="0.9.8"']
compiler_options += ['-DPACKAGE_URL="https://github.com/dequis/purple-facebook/"']
# Add compiler flags if warnings are enabled
if get_option('warnings')
add_project_arguments('-Wall', '-Wextra', '-Waggregate-return', '-Wdeclaration-after-statement', '-Wfloat-equal', '-Wformat', '-Winit-self', '-Wmissing-declarations', '-Wmissing-prototypes', '-Wno-unused-parameter', '-Wpointer-arith', language : 'c')
endif
# Argument for specifying the libpurple plugin directory
plugin_dir = get_option('plugindir')
plugin_cflags = ['-I@0@/include'.format(meson.current_source_dir()),
'-I@0@/pidgin'.format(meson.current_source_dir()),
'-I@0@/pidgin/libpurple'.format(meson.current_source_dir()),
'-Ipidgin/libpurple/', # Adjust this path
'-DPURPLE_PLUGINS',
'-include', 'purple-compat.h']
add_project_arguments(plugin_cflags, language : 'c')
# Dependency checks using pkg-config
glib_dep = dependency('glib-2.0', version : '>=2.28.0')
json_dep = dependency('json-glib-1.0', version : '>=0.14.0')
purple_dep = dependency('purple', version : '<3')
zlib_dep = dependency('zlib')
# Check for glib-genmarshal tool
glib_genmarshal = find_program('glib-genmarshal')
if not glib_genmarshal.found()
error('The `glib-genmarshal` tool is missing.')
endif
generate_marshal_header_command = ['glib-genmarshal', 'pidgin/libpurple/protocols/facebook/marshaller.list', '--prefix=fb_marshal', '--header', '--output', 'pidgin/libpurple/protocols/facebook/marshal.h']
generate_marshal_c_command = ['glib-genmarshal', 'pidgin/libpurple/protocols/facebook/marshaller.list', '--body', '--prefix=fb_marshal', '--output', 'pidgin/libpurple/protocols/facebook/marshal.c']
run_command(generate_marshal_header_command,
check: true)
run_command(generate_marshal_c_command,
check: true)
# Define source files
source_files = files(
'pidgin/libpurple/protocols/facebook/marshal.c',
'pidgin/libpurple/protocols/facebook/api.c',
'pidgin/libpurple/protocols/facebook/data.c',
'pidgin/libpurple/protocols/facebook/facebook.c',
'pidgin/libpurple/protocols/facebook/http.c',
'pidgin/libpurple/protocols/facebook/json.c',
'pidgin/libpurple/protocols/facebook/mqtt.c',
'pidgin/libpurple/protocols/facebook/thrift.c',
'pidgin/libpurple/protocols/facebook/util.c',
'pidgin/libpurple/http.c',
'pidgin/libpurple/purple-socket.c'
)
# Determine the plugin directory if not provided by the user
if plugin_dir == ''
purple_plugindir = ''
if purple_dep.found()
purple_plugindir = purple_dep.get_pkgconfig_variable('plugindir')
endif
if purple_plugindir == ''
purple_plugindir = join_paths(get_option('libdir'), 'purple-2')
endif
else
purple_plugindir = plugin_dir
endif
# Define library
plugin_library = shared_library('facebook', source_files, dependencies : [glib_dep, json_dep, purple_dep, zlib_dep], c_args: compiler_options, install: true, install_dir: purple_plugindir)