Merge "subparse: Remove gst_event_unref when not support byte seek" into tizen
[platform/upstream/gst-plugins-base.git] / meson.build
index ab5c8cf..767f98f 100644 (file)
@@ -1,5 +1,5 @@
 project('gst-plugins-base', 'c',
-  version : '1.15.0.1',
+  version : '1.16.2',
   meson_version : '>= 0.47',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
@@ -27,10 +27,11 @@ api_version = '1.0'
 soversion = 0
 # maintaining compatibility with the previous libtool versioning
 # current = minor * 100 + micro
-# FIXME: should be able to convert string to int somehow so we can just do maths
-libversion = '@0@.@1@.0'.format(soversion, gst_version_minor * 100 + gst_version_micro)
+curversion = gst_version_minor * 100 + gst_version_micro
+libversion = '@0@.@1@.0'.format(soversion, curversion)
+osxversion = curversion + 1
 
-plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
+plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0')
 
 cc = meson.get_compiler('c')
 host_system = host_machine.system()
@@ -45,6 +46,7 @@ if cc.get_id() == 'msvc'
       '/wd4146', # unary minus on unsigned (beware INT_MIN)
       '/wd4244', # lossy type conversion (e.g. double -> int)
       '/wd4305', # truncating type conversion (e.g. double -> float)
+      cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
       language : 'c')
   # Disable SAFESEH with MSVC for plugins and libs that use external deps that
   # are built with MinGW
@@ -57,11 +59,21 @@ if cc.has_link_argument('-Wl,-Bsymbolic-functions')
   add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
 endif
 
+core_conf = configuration_data()
+
 # Symbol visibility
-if cc.has_argument('-fvisibility=hidden')
+if cc.get_id() == 'msvc'
+  export_define = '__declspec(dllexport) extern'
+elif cc.has_argument('-fvisibility=hidden')
   add_project_arguments('-fvisibility=hidden', language: 'c')
+  export_define = 'extern __attribute__ ((visibility ("default")))'
+else
+  export_define = 'extern'
 endif
 
+# Passing this through the command line would be too messy
+core_conf.set('GST_API_EXPORT', export_define)
+
 # Disable strict aliasing
 if cc.has_argument('-fno-strict-aliasing')
   add_project_arguments('-fno-strict-aliasing', language: 'c')
@@ -85,7 +97,12 @@ if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev)
   add_project_arguments('-DG_DISABLE_ASSERT', language: 'c')
 endif
 
-core_conf = configuration_data()
+glib_checks = get_option('glib-checks')
+if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
+  message('Disabling GLib checks')
+  add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
+endif
+
 check_headers = [
   ['HAVE_DLFCN_H', 'dlfcn.h'],
   ['HAVE_EMMINTRIN_H', 'emmintrin.h'],
@@ -233,8 +250,13 @@ glib_deps = [dependency('glib-2.0', version : glib_req, fallback: ['glib', 'libg
              dependency('gobject-2.0', fallback: ['glib', 'libgobject_dep'])]
 # GIO is used by the GIO plugin, and by the TCP, SDP, and RTSP plugins
 gio_dep = dependency('gio-2.0', fallback: ['glib', 'libgio_dep'])
-giounix_dep = dependency('gio-unix-2.0', version : glib_req, required : host_system != 'windows',
-                         fallback: ['glib', 'libgiounix_dep'])
+giounix_dep = dependency('', required: false)
+if host_system != 'windows'
+  giounix_dep = dependency('gio-unix-2.0', version : glib_req,
+                           fallback: ['glib', 'libgiounix_dep'])
+endif
+gmodule_dep = dependency('gmodule-no-export-2.0',
+                         fallback: ['glib', 'libgmodule_dep'])
 
 # some of the examples can use gdk-pixbuf and GTK+3
 gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', required : get_option('examples'))
@@ -281,17 +303,17 @@ gst_base_dep = dependency('gstreamer-base-1.0', version : gst_req,
   fallback : ['gstreamer', 'gst_base_dep'])
 gst_net_dep = dependency('gstreamer-net-1.0', version : gst_req,
   fallback : ['gstreamer', 'gst_net_dep'])
-if host_system != 'windows'
-  gst_check_dep = dependency('gstreamer-check-1.0', version : gst_req,
-    fallback : ['gstreamer', 'gst_check_dep'])
-endif
+gst_check_dep = dependency('gstreamer-check-1.0', version : gst_req,
+  required : get_option('tests'),
+  fallback : ['gstreamer', 'gst_check_dep'])
 gst_controller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
   fallback : ['gstreamer', 'gst_controller_dep'])
 
 have_orcc = false
 orcc_args = []
 # Used by various libraries/elements that use Orc code
-orc_dep = dependency('orc-0.4', version : orc_req, required : get_option('orc'))
+orc_dep = dependency('orc-0.4', version : orc_req, required : get_option('orc'),
+    fallback : ['orc', 'orc_dep'])
 orcc = find_program('orcc', required : get_option('orc'))
 if orc_dep.found() and orcc.found()
   have_orcc = true
@@ -311,6 +333,18 @@ have_sse = cc.has_argument(sse_args)
 have_sse2 = cc.has_argument(sse2_args)
 have_sse41 = cc.has_argument(sse41_args)
 
+if host_machine.cpu_family() == 'arm'
+  if cc.compiles('''
+#include <arm_neon.h>
+int32x4_t testfunc(int16_t *a, int16_t *b) {
+  asm volatile ("vmull.s16 q0, d0, d0" : : : "q0");
+  return vmull_s16(vld1_s16(a), vld1_s16(b));
+}
+''', name : 'NEON support')
+    core_conf.set('HAVE_ARM_NEON', true)
+  endif
+endif
+
 if gst_dep.type_name() == 'internal'
     gst_proj = subproject('gstreamer')
 
@@ -343,7 +377,7 @@ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' +
     'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
     'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
     'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
-    'gst_init(NULL,NULL);' ]
+    'gst_init(NULL,NULL);', '--quiet']
 
 pkgconfig = import('pkgconfig')
 plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
@@ -356,7 +390,9 @@ subdir('gst-libs')
 subdir('gst')
 subdir('ext')
 subdir('sys')
-subdir('tools')
+if not get_option('tools').disabled()
+  subdir('tools')
+endif
 subdir('tests')
 subdir('pkgconfig')
 
@@ -379,5 +415,5 @@ endif
 # Use core_conf after all subdirs have set values
 configure_file(output : 'config.h', configuration : core_conf)
 
-python3 = import('python3').find_python()
+python3 = import('python').find_installation()
 run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')