Add new symbol to docs and .def file
[platform/upstream/gstreamer.git] / meson.build
index 5941d7a..cbc3d5d 100644 (file)
@@ -1,14 +1,14 @@
 project('gstreamer', 'c',
-  version : '1.13.0.1',
+  version : '1.13.1.1',
   meson_version : '>= 0.40.1',
   default_options : [ 'warning_level=1',
                       'buildtype=debugoptimized' ])
 
 gst_version = meson.project_version()
 version_arr = gst_version.split('.')
-gst_version_major = version_arr[0]
-gst_version_minor = version_arr[1]
-gst_version_micro = version_arr[2]
+gst_version_major = version_arr[0].to_int()
+gst_version_minor = version_arr[1].to_int()
+gst_version_micro = version_arr[2].to_int()
 if version_arr.length() == 4
   gst_version_nano = version_arr[3].to_int()
 else
@@ -21,7 +21,7 @@ apiversion = '1.0'
 soversion = 0
 # maintaining compatibility with the previous libtool versioning
 # current = minor * 100 + micro
-libversion = '@0@.@1@.0'.format(soversion, gst_version_minor.to_int() * 100 + gst_version_micro.to_int())
+libversion = '@0@.@1@.0'.format(soversion, gst_version_minor * 100 + gst_version_micro)
 
 prefix = get_option('prefix')
 libtype = get_option('library_format')
@@ -45,7 +45,17 @@ if cc.get_id() == 'msvc'
 elif cc.has_argument('-Wl,-Bsymbolic-functions')
   # FIXME: Add an option for this if people ask for it
   add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
-  # FIXME: Add FATAL_WARNINGS from configure.ac
+endif
+
+# Symbol visibility
+have_visibility_hidden = cc.has_argument('-fvisibility=hidden')
+if have_visibility_hidden
+  add_project_arguments('-fvisibility=hidden', language: 'c')
+endif
+
+# Disable strict aliasing
+if cc.has_argument('-fno-strict-aliasing')
+  add_project_arguments('-fno-strict-aliasing', language: 'c')
 endif
 
 cdata = configuration_data()
@@ -72,6 +82,10 @@ cdata.set_quoted('GST_PTP_HELPER_INSTALLED', join_paths(prefix, helpers_install_
 cdata.set_quoted('GST_PLUGIN_SCANNER_SUBDIR', libexecdir,
   description: 'libexecdir path component, used to find plugin-scanner on relocatable builds on windows')
 
+if host_system == 'darwin'
+  cdata.set_quoted('GST_EXTRA_MODULE_SUFFIX', '.dylib')
+endif
+
 if gst_version_nano > 0
     # Have GST_ERROR message printed when running from git
     cdata.set('GST_LEVEL_DEFAULT', 'GST_LEVEL_ERROR')
@@ -320,11 +334,37 @@ if cc.has_header('execinfo.h')
 endif
 
 disable_gst_debug = get_option('disable_gst_debug')
-if get_option('disable_gst_debug')
-    cdata.set('GST_DISABLE_GST_DEBUG_DEFINE', '#define GST_DISABLE_GST_DEBUG 1')
+if disable_gst_debug
   add_project_arguments(['-Wno-unused'], language: 'c')
 endif
 
+warning_flags = [
+  '-Wmissing-declarations',
+  '-Wmissing-prototypes',
+  '-Wredundant-decls',
+  '-Wundef',
+  '-Wwrite-strings',
+  '-Wformat',
+  '-Wformat-nonliteral',
+  '-Wformat-security',
+  '-Wold-style-definition',
+  '-Winit-self',
+  '-Wmissing-include-dirs',
+  '-Waddress',
+  '-Waggregate-return',
+  '-Wno-multichar',
+  '-Wnested-externs',
+  '-Wdeclaration-after-statement',
+  '-Wvla',
+  '-Wpointer-arith',
+]
+
+foreach extra_arg : warning_flags
+  if cc.has_argument (extra_arg)
+    add_project_arguments([extra_arg], language: 'c')
+  endif
+endforeach
+
 # Used by the gstutils test
 gmp_dep = cc.find_library('gmp', required : false)
 cdata.set('HAVE_GMP', gmp_dep.found())
@@ -376,7 +416,6 @@ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' +
     'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
     'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
     'gst_init(NULL,NULL);' ]
-vs_module_defs_dir = meson.current_source_dir() + '/win32/common/'
 
 # Used by the *_mkenum.py helper scripts
 glib_mkenums = find_program('glib-mkenums')
@@ -430,9 +469,13 @@ subdir('plugins')
 subdir('tools')
 subdir('pkgconfig')
 subdir('tests')
-subdir('po')
 subdir('data')
 
+# xgettext is optional (on Windows for instance)
+if find_program('xgettext', required : false).found()
+  subdir('po')
+endif
+
 configure_file(output : 'config.h', configuration : cdata)
 
 if build_machine.system() == 'windows'