aboutsummaryrefslogtreecommitdiffstats
path: root/src/meson.build
blob: bb0f4d7f4a0c9fddea98d4638bc0521379bc0d06 (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
###########################################################################
# Copyright (C) 2018 "IoT.bzh"
#
# author: José Bollo <jose.bollo@iot.bzh>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###########################################################################

coresrcs = files(
   'anydb.c',
   'cyn.c',
   'db.c',
   'dbinit.c',
   'expire.c',
   'fbuf.c',
   'filedb.c',
   'memdb.c',
   'names.c',
   'pollitem.c',
   'queue.c'
)

srvsrcs = files(
   'agent-at.c',
   'cyn-protocol.c',
   'cyn-server.c',
   'idgen.c',
   'main-cynagorad.c',
   'prot.c',
   'socket.c'
)

clisrcs = files(
   'cache.c',
   'cyn-protocol.c',
   'cynagora.c',
   'expire.c',
   'idgen.c',
   'names.c',
   'prot.c',
   'socket.c'
)

###########################################
# build and install libcynagora-core
###########################################
corelib = shared_library('cynagora-core', coresrcs,
   version: cynagora_version, soversion: cynagora_soversion,
   link_args: '-Wl,--version-script='+meson.current_source_dir()+'/export-cynagora-core.map',
   install: true
)

###########################################
# build and install libcynagora-client
###########################################
clilib = shared_library('cynagora', clisrcs,
   version: cynagora_version, soversion: cynagora_soversion,
   c_args: '-DDEFAULT_SOCKET_DIR="' + socketdir + '"',
   link_args: '-Wl,--version-script='+meson.current_source_dir()+'/export-cynagora.map',
   install: true
)
install_headers('cynagora.h')

###########################################
# build and install cynagorad
###########################################
executable('cynagorad', srvsrcs,
   c_args: [
      '-DDEFAULT_DB_DIR="' + dbdir + '"',
      '-DDEFAULT_SOCKET_DIR="' + socketdir + '"',
      '-DDEFAULT_INIT_FILE="' + init_file + '"',
      get_option('with-cynara-compat') ? '-DWITH_SYSTEMD_ACTIVATION' : '-DWITHOUT_SYSTEMD_ACTIVATION'
   ],
   dependencies: [ sysd, cap ],
   link_with: corelib,
   install: true
)

###########################################
# build and install cynagora-admin
###########################################
executable('cynagora-admin', 'main-cynagora-admin.c', 'expire.c', link_with: clilib, install: true)

###########################################
# build and install cynagora-agent
###########################################
executable('cynagora-agent', 'main-cynagora-agent.c', 'expire.c', link_with: clilib, install: true)