meson: bump version
[platform/upstream/gstreamer.git] / meson.build
1 project('gst-editing-services', 'c',
2   version : '1.11.1.1',
3   meson_version : '>= 0.36.0',
4   default_options : [ 'warning_level=1',
5                       'buildtype=debugoptimized' ])
6
7 gst_version = meson.project_version()
8 version_arr = gst_version.split('.')
9 gst_version_major = version_arr[0]
10 gst_version_minor = version_arr[1]
11 gst_version_micro = version_arr[2]
12 if version_arr.length() == 4
13   gst_version_nano = version_arr[3]
14 else
15   gst_version_nano = 0
16 endif
17
18 apiversion = '1.0'
19 soversion = 0
20 # maintaining compatibility with the previous libtool versioning
21 # current = minor * 100 + micro
22 libversion = '@0@.@1@.0'.format(soversion, gst_version_minor.to_int() * 100 + gst_version_micro.to_int())
23
24 glib_req = '>= 2.40.0'
25 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
26
27 cc = meson.get_compiler('c')
28 # Ignore several spurious warnings for things gstreamer does very commonly
29 # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
30 # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
31 # NOTE: Only add warnings here if you are sure they're spurious
32 if cc.get_id() == 'msvc'
33   add_project_arguments(
34       '/wd4018', # implicit signed/unsigned conversion
35       '/wd4146', # unary minus on unsigned (beware INT_MIN)
36       '/wd4244', # lossy type conversion (e.g. double -> int)
37       '/wd4305', # truncating type conversion (e.g. double -> float)
38       language : 'c')
39 endif
40
41 cdata = configuration_data()
42 cdata.set('VERSION', '"@0@"'.format(gst_version))
43 cdata.set('PACKAGE', '"gst-editing-services"')
44 cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version))
45 cdata.set('PACKAGE_BUGREPORT', '"http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer"')
46 cdata.set('PACKAGE_NAME', '"GStreamer Editing Services"')
47 cdata.set('GST_PACKAGE_NAME', '"GStreamer Editing Services"')
48 cdata.set('GST_PACKAGE_ORIGIN', '"Unknown package origin"')
49 cdata.set('GST_LICENSE', '"LGPL"')
50 cdata.set('LIBDIR', '"@0@"'.format(get_option('libdir')))
51
52 # Mandatory GST deps
53 gst_dep = dependency('gstreamer-' + apiversion, version : gst_req,
54     fallback : ['gstreamer', 'gst_dep'])
55 gstpbutils_dep = dependency('gstreamer-pbutils-' + apiversion, version : gst_req,
56     fallback : ['gst-plugins-base', 'pbutils_dep'])
57 gstvideo_dep = dependency('gstreamer-video-' + apiversion, version : gst_req,
58     fallback : ['gst-plugins-base', 'video_dep'])
59 gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
60     fallback : ['gstreamer', 'gst_base_dep'])
61 if host_machine.system() != 'windows'
62   gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
63     fallback : ['gstreamer', 'gst_check_dep'], required: false)
64 endif
65 gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
66   fallback : ['gstreamer', 'gst_controller_dep'])
67
68 # gst-validate has a hard-dep on json-glib-1.0 so maintain optionality of it all
69 # by only dragging it in as a fallback if we know we can satisfy the dependencies
70 if dependency('json-glib-1.0').found()
71   gstvalidate_dep = dependency('gst-validate-1.0', version : gst_req, required : false,
72     fallback : ['gst-devtools', 'validate_dep'])
73 else
74   gstvalidate_dep = dependency('gst-validate-1.0', vesion: gst_req, required : false)
75 endif
76
77 gio_dep = dependency('gio-2.0', version : glib_req)
78 libxml_dep = dependency('libxml-2.0')
79
80 # TODO Properly port to Gtk 3
81 # gtk_dep = dependency('gtk+-3.0', required : false)
82
83 libges_deps = [gst_dep, gstbase_dep, gstvideo_dep, gstpbutils_dep,
84                gstcontroller_dep, gio_dep, libxml_dep]
85
86 if gstvalidate_dep.found()
87     libges_deps = libges_deps + [gstvalidate_dep]
88     cdata.set('HAVE_GST_VALIDATE', 1)
89 endif
90
91 configure_file(input : 'config.h.meson',
92   output : 'config.h',
93   configuration : cdata)
94
95
96 gir = find_program('g-ir-scanner', required : false)
97 gnome = import('gnome')
98 gtkdoc = find_program('gtkdoc-scan', required : false)
99
100 # Fixme, not very elegant.
101 build_gir = gir.found() and not meson.is_cross_build() and not get_option('disable_introspection')
102 gir_init_section = [ '--add-init-section=' + \
103     'extern void gst_init(gint*,gchar**);' + \
104     'extern void ges_init(void);' + \
105     'g_setenv("GST_REGISTRY_1.0", "/no/way/this/exists.reg", TRUE);' + \
106     'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
107     'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
108     'g_setenv("GST_DEBUG", "0", TRUE);' + \
109     'gst_init(NULL,NULL);' + \
110     'ges_init();' ]
111
112 ges_c_args = ['-DHAVE_CONFIG_H']
113 plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
114
115 vs_module_defs_dir = meson.current_source_dir() + '/win32/common/'
116
117 if gst_dep.type_name() == 'internal'
118     gst_proj = subproject('gstreamer')
119
120     if gst_proj.get_variable('disable_gst_debug')
121         message('GStreamer debug system is disabled')
122         add_project_arguments('-Wno-unused', language: 'c')
123     else
124         message('GStreamer debug system is enabled')
125     endif
126 else
127     # We can't check that in the case of subprojects as we won't
128     # be able to build against an internal dependency (which is not built yet)
129     if not cc.compiles('''
130 #include <gst/gstconfig.h>
131 #ifdef GST_DISABLE_GST_DEBUG
132 #error "debugging disabled, make compiler fail"
133 #endif''' , dependencies: gst_dep)
134         message('GStreamer debug system is disabled')
135         add_global_arguments('-Wno-unused', language: 'c')
136     else
137         message('GStreamer debug system is enabled')
138     endif
139 endif
140
141 configinc = include_directories('.')
142 subdir('ges')
143 subdir('plugins')
144 subdir('tools')
145 subdir('pkgconfig')
146 subdir('tests')
147 subdir('examples')
148
149 if build_machine.system() != 'windows'
150   if gtkdoc.found()
151     subdir('docs')
152   else
153     message('Not building documentation as gtk-doc was not found')
154   endif
155 else
156   message('Disabling gtk-doc while building on Windows')
157 endif
158
159 python3 = find_program('python3')
160 run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')