File: meson.build

package info (click to toggle)
spice-gtk 0.42-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,792 kB
  • sloc: ansic: 57,963; python: 3,961; cpp: 902; makefile: 545; xml: 159; sh: 134
file content (192 lines) | stat: -rw-r--r-- 6,095 bytes parent folder | download | duplicates (6)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#
# libspice-common
#
spice_common_sources = [
  'agent.c',
  'agent.h',
  'backtrace.c',
  'backtrace.h',
  'canvas_utils.c',
  'canvas_utils.h',
  'demarshallers.h',
  'draw.h',
  'lines.c',
  'lines.h',
  'log.c',
  'log.h',
  'lz.c',
  'lz.h',
  'lz_common.h',
  'lz_config.h',
  'macros.h',
  'marshaller.c',
  'marshaller.h',
  'mem.c',
  'mem.h',
  'messages.h',
  'pixman_utils.c',
  'pixman_utils.h',
  'quic.c',
  'quic.h',
  'quic_config.h',
  'rect.h',
  'region.c',
  'region.h',
  'ring.h',
  'rop3.c',
  'rop3.h',
  'snd_codec.c',
  'snd_codec.h',
  'utils.c',
  'utils.h',
  'verify.h',
  'recorder.h'
]

if get_option('instrumentation') == 'recorder'
  spice_common_sources += [
    'recorder/recorder.c',
    'recorder/recorder.h',
    'recorder/recorder_ring.c',
    'recorder/recorder_ring.h'
  ]
endif
if get_option('instrumentation') == 'agent'
  spice_common_sources += [
    'agent_interface.c',
    'agent_interface.h'
  ]
endif

spice_common_lib = static_library('spice-common', spice_common_sources,
                                  install : false,
                                  include_directories : spice_common_include,
                                  dependencies : spice_common_deps)

spice_common_dep = declare_dependency(link_with : spice_common_lib,
                                      include_directories : spice_common_include,
                                      dependencies : spice_common_deps)


# client_demarshallers
if spice_common_generate_client_code or spice_common_generate_server_code
  codegen_cmd = [python, spice_codegen]
  codegen_args = ['--generate-demarshallers',
                  '--client',
                  '--include', 'common/messages.h',
                  '--generated-declaration-file', '@OUTPUT1@',
                  '@INPUT@', '@OUTPUT0@']

  client_demarshallers = custom_target('client_demarshallers',
                                       input : [spice_proto],
                                       output : ['generated_client_demarshallers.c', 'generated_messages.h'],
                                       install : false,
                                       command : [codegen_cmd, codegen_args],
                                       depend_files : [spice_codegen_files, 'messages.h'])
endif

#
# libspice-common-client
#
if spice_common_generate_client_code
  # client_marshallers
  codegen_args = ['--generate-marshallers',
                  '--generate-header',
                  '-P',
                  '--client',
                  '--include', 'common/client_marshallers.h',
                  '@INPUT0@', '@OUTPUT0@']

  client_marshallers = custom_target('client_marshallers',
                                     input : [spice_proto, client_demarshallers],
                                     output : ['generated_client_marshallers.c', 'generated_client_marshallers.h'],
                                     install : false,
                                     command : [codegen_cmd, codegen_args],
                                     depend_files : [spice_codegen_files, 'client_marshallers.h'])

  spice_common_client_sources = [
    client_demarshallers,
    client_marshallers,
    'client_marshallers.h',
    'ssl_verify.c',
    'ssl_verify.h',
  ]

  spice_common_client_lib = static_library('spice-common-client', spice_common_client_sources,
                                           install : false,
                                           dependencies : [spice_common_dep, gio2_deps])

  spice_common_client_dep = declare_dependency(sources : client_marshallers[1],
                                               link_with : spice_common_client_lib,
                                               dependencies : [spice_common_dep, gio2_deps])
endif

#
# libspice-common-server
#
if spice_common_generate_server_code
  structs_args = [
   '-M', 'String',
   '-M', 'Rect',
   '-M', 'Point',
   '-M', 'DisplayBase',
   '-M', 'Fill',
   '-M', 'Opaque',
   '-M', 'Copy',
   '-M', 'Blend',
   '-M', 'Blackness',
   '-M', 'Whiteness',
   '-M', 'Invers',
   '-M', 'Rop3',
   '-M', 'Stroke',
   '-M', 'Text',
   '-M', 'Transparent',
   '-M', 'AlphaBlend',
   '-M', 'Composite',
  ]

  targets = [
    { 'name' : 'server_demarshallers',
      'input' : [ spice_proto, client_demarshallers ],
      'output' : ['generated_server_demarshallers.c'],
      'codegen_args' : ['--generate-demarshallers',
                        '--server',
                        '--include', 'common/messages.h',
                        '@INPUT0@', '@OUTPUT0@'],
    },
    { 'name' : 'server_marshallers',
      'input' : [ spice_proto, client_demarshallers ],
      'output' : ['generated_server_marshallers.c', 'generated_server_marshallers.h'],
      'codegen_args' : ['--generate-marshallers',
                        '--generate-header',
                        '--server',
                        structs_args,
                        '--include', 'common/messages.h',
                        '@INPUT0@', '@OUTPUT0@']
    },
  ]

  spice_common_server_sources = []
  spice_common_server_dep_sources = []

  foreach t : targets
    target = custom_target(t['name'],
                           input : t['input'],
                           output : t['output'],
                           install : false,
                           command : [codegen_cmd, t['codegen_args']],
                           depend_files : [spice_codegen_files, 'messages.h'])
    spice_common_server_sources += target
    if t['output'].length() > 1
      spice_common_server_dep_sources += target[1]
    endif
  endforeach

  spice_common_server_lib = static_library('spice-common-server', spice_common_server_sources,
                                           install : false,
                                           dependencies : spice_common_dep)

  spice_common_server_dep = declare_dependency(sources : spice_common_server_dep_sources,
                                               link_with : spice_common_server_lib,
                                               dependencies : spice_common_dep)
endif