summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2017-11-29 18:56:30 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2017-11-29 19:38:38 +0100
commit7720ee72ffd5a4325e401e817177644651dc3fc0 (patch)
treedd0393bbfaf0d88a908fb1c70d1a9a43ba2eb628
parent94898df6b4a0977a4fbf3400e8466e1ab4230521 (diff)
Initial pass at adding meson supportmeson
Not much checks for dependencies, missing client/server split during build, ...
-rw-r--r--common/meson.build109
-rw-r--r--meson.build13
2 files changed, 122 insertions, 0 deletions
diff --git a/common/meson.build b/common/meson.build
new file mode 100644
index 0000000..94abb54
--- /dev/null
+++ b/common/meson.build
@@ -0,0 +1,109 @@
+spice_common_sources = [
+ 'backtrace.c',
+ 'backtrace.h',
+ 'bitops.h',
+ 'canvas_utils.c',
+ 'canvas_utils.h',
+ 'client_demarshallers.h',
+ 'client_marshallers.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',
+ 'spice_common.h',
+ 'ssl_verify.c',
+ 'ssl_verify.h',
+ 'verify.h'
+]
+
+spice_proto = '@0@/../spice.proto'.format(meson.current_source_dir())
+spice1_proto = '@0@/../spice1.proto'.format(meson.current_source_dir())
+spice_codegen = '@0@/../spice_codegen.py'.format(meson.current_source_dir())
+
+client_demarshallers = custom_target('client_demarshallers',
+ output : 'generated_client_demarshallers.c',
+ input : spice_proto, #MARSHALLER_DEPS
+ command : [spice_codegen, '--generate-demarshallers', '--client', '--include', 'common/messages.h', '@INPUT@', '@OUTPUT@'])
+client_demarshallers1 = custom_target('client_demarshallers1',
+ output : 'generated_client_demarshallers1.c',
+ input : spice1_proto, #MARSHALLER_DEPS
+ command : [spice_codegen, '--generate-demarshallers', '--client', '--include', 'common/messages.h', '--prefix', '1', '--ptrsize', '8', '@INPUT@', '@OUTPUT@'])
+client_marshallers_h = custom_target('client_marshallers_h',
+ output : 'generated_client_marshallers.h',
+ input : spice_proto, #MARSHALLER_DEPS
+ command : [spice_codegen, '--generate-marshallers', '-P', '--client', '--include', 'common/messages.h', '-H', '@INPUT@', '@OUTPUT@'])
+client_marshallers = custom_target('client_marshallers',
+ output : 'generated_client_marshallers.c',
+ input : spice_proto, #MARSHALLER_DEPS
+ command : [spice_codegen, '--generate-marshallers', '-P', '--include', 'client_marshallers.h', '--client', '@INPUT@', '@OUTPUT@'])
+client_marshallers1 = custom_target('client_marshallers1',
+ output : 'generated_client_marshallers1.c',
+ input : spice1_proto, #MARSHALLER_DEPS
+ command : [spice_codegen, '--generate-marshallers', '-P', '--include', 'common/messages.h', '--include', 'client_marshallers.h', '--client', '--prefix', '1', '--ptrsize', '8', '@INPUT@', '@OUTPUT@'])
+server_demarshallers = custom_target('server_demarshallers',
+ output : 'generated_server_demarshallers.c',
+ input : spice_proto, #MARSHALLER_DEPS
+ command : [spice_codegen, '--generate-demarshallers', '--server', '--include', 'common/messages.h', '@INPUT@', '@OUTPUT@'])
+
+STRUCTS = [ '-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', ]
+server_marshallers_h = custom_target('server_marshallers_h',
+ output : 'generated_server_marshallers.h',
+ input : spice_proto, #MARSHALLER_DEPS
+ command : [spice_codegen, '--generate-marshallers'] + STRUCTS + ['--server', '--include', 'common/messages.h', '-H', '@INPUT@', '@OUTPUT@'])
+server_marshallers = custom_target('server_marshallers',
+ output : 'generated_server_marshallers.c',
+ input : spice_proto, #MARSHALLER_DEPS
+ command : [spice_codegen, '--generate-marshallers'] + STRUCTS + ['--server', '--include', 'common/messages.h', '@INPUT@', '@OUTPUT@'])
+spice_common_client_sources = [ client_demarshallers, client_demarshallers1, client_marshallers_h, client_marshallers, client_marshallers1 ]
+spice_common_server_sources = [ server_demarshallers, server_marshallers_h, server_marshallers ]
+
+built_sources = []
+c_args = []
+private_c_args = [
+ '-DG_LOG_DOMAIN="libgd"',
+ '-DG_DISABLE_DEPRECATED',
+]
+spice_common_lib = static_library('spice-common', spice_common_sources,
+ dependencies: [ deps ],
+ include_directories: spice_common_include,
+ c_args: c_args + private_c_args)
+spice_common_server_lib = static_library('spice-common-server', spice_common_server_sources,
+ dependencies: [ deps ],
+ include_directories: spice_common_include,
+ c_args: c_args + private_c_args + [ '-DFIXME_SERVER_SMARTCARD' ])
+spice_common_client_lib = static_library('spice-common-client', spice_common_client_sources,
+ dependencies: [ deps ],
+ include_directories: spice_common_include,
+ c_args: c_args + private_c_args)
+
+libgd_dep = declare_dependency(
+ link_with: spice_common_lib,
+ include_directories: spice_common_include,
+ dependencies: deps,
+ compile_args: c_args,
+ sources: built_sources
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..af1667c
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,13 @@
+project('spice-common', 'c',
+ meson_version: '>= 0.38.0',
+ default_options: ['static=true']
+)
+
+#if not meson.is_subproject()
+# message('WARNING: This project is only intended to be used as a subproject!')
+#endif
+
+deps = dependency('glib-2.0 spice-protocol pixman-1')
+spice_common_include = include_directories('.')
+
+subdir('common')