summaryrefslogtreecommitdiff
path: root/libgupnp/meson.build
blob: b86771afb322cc1ade41390c18f3ac641927f485 (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
context_manager_impl = []
context_manager_args = []

if host_machine.system() == 'windows'
    context_manager_impl += 'gupnp-windows-context-manager.c'
else
    if ifaddrs_available
        context_manager_impl += 'gupnp-unix-context-manager.c'
    endif
    if get_option('context_manager') == 'network-manager'
        context_manager_impl += 'gupnp-network-manager.c'
        context_manager_args += '-DUSE_NETWORK_MANAGER'
    endif
    if get_option('context_manager') == 'connman'
        context_manager_impl += 'gupnp-connman-manager.c'
        context_manager_args += '-DUSE_CONNMAN'
    endif
endif

if netlink_available
    context_manager_impl += 'gupnp-linux-context-manager.c'
endif

if get_option('context_manager') == 'linux'
    context_manager_args += '-DUSE_NETLINK'
endif

enums = gnome.mkenums(
    'gupnp-enums',
    sources : [
        'gupnp-error.h',
        'gupnp-service-introspection.h'
    ],
    identifier_prefix : 'GUPnP',
    symbol_prefix : 'gupnp',
    c_template : 'gupnp-enums.c.template',
    h_template : 'gupnp-enums.h.template',
    install_header : true,
    install_dir : join_paths (get_option('includedir'), 'gupnp-1.2/libgupnp')
)

headers = files(
    'gupnp-acl.h',
    'gupnp-context.h',
    'gupnp-context-manager.h',
    'gupnp-control-point.h',
    'gupnp-device.h',
    'gupnp-device-info.h',
    'gupnp-device-proxy.h',
    'gupnp-error.h',
    'gupnp.h',
    'gupnp-resource-factory.h',
    'gupnp-root-device.h',
    'gupnp-service.h',
    'gupnp-service-info.h',
    'gupnp-service-introspection.h',
    'gupnp-service-proxy.h',
    'gupnp-types.h',
    'gupnp-uuid.h',
    'gupnp-white-list.h',
    'gupnp-xml-doc.h'
)
install_headers(headers, subdir : 'gupnp-1.2/libgupnp')

sources = files(
    'gupnp-acl.c',
    'gupnp-context.c',
    'gupnp-context-manager.c',
    'gupnp-control-point.c',
    'gupnp-device.c',
    'gupnp-device-info.c',
    'gupnp-device-proxy.c',
    'gupnp-error.c',
    'gupnp-resource-factory.c',
    'gupnp-root-device.c',
    'gupnp-service.c',
    'gupnp-service-info.c',
    'gupnp-service-introspection.c',
    'gupnp-service-proxy.c',
    'gupnp-simple-context-manager.c',
    'gupnp-types.c',
    'gupnp-white-list.c',
    'gupnp-xml-doc.c',
    'gvalue-util.c',
    'http-headers.c',
    'xml-util.c'
)

libgupnp = library(
    'gupnp-1.2',
    sources + context_manager_impl + enums,
    version : '0.0.0',
    dependencies : dependencies,
    c_args : context_manager_args,
    include_directories: include_directories('..'),
    install: true
)

gupnp = declare_dependency(
    link_with: libgupnp,
    include_directories : include_directories('..'),
    dependencies : dependencies
)

pkg.generate(
    libraries : libgupnp,
    subdirs: 'gupnp-1.2',
    name : 'gupnp-1.2',
    description : 'GObject-based UPnP library',
    version : meson.project_version(),
    filebase : 'gupnp-1.2'
)

if get_option('introspection')
    gir = gnome.generate_gir(
        libgupnp,
        sources : headers + sources + enums,
        namespace : 'GUPnP',
        nsversion : '1.2',
        header : 'libgupnp/gupnp.h',
        symbol_prefix : 'gupnp',
        identifier_prefix : 'GUPnP',
        export_packages : 'gupnp-1.2',
        includes : ['GObject-2.0', 'Gio-2.0', 'Soup-2.4', 'GSSDP-1.2', 'libxml2-2.0'],
        install : true,
        extra_args : '-DGOBJECT_INTROSPECTION_SKIP'
    )
endif