gstconfig.h: want deprecation warnings if GST_DISABLE_DEPRECATED is *set*
[platform/upstream/gstreamer.git] / meson.build
index 844950c..8855171 100644 (file)
@@ -6,9 +6,9 @@ project('gstreamer', 'c',
 
 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')
@@ -48,6 +48,17 @@ elif cc.has_argument('-Wl,-Bsymbolic-functions')
   # 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()
 cdata.set_quoted('GST_API_VERSION', apiversion)
 cdata.set_quoted('GST_DATADIR', join_paths(prefix, get_option('datadir')))
@@ -69,6 +80,8 @@ cdata.set_quoted('VERSION', gst_version)
 cdata.set('MEMORY_ALIGNMENT_MALLOC', 1)
 cdata.set_quoted('GST_PLUGIN_SCANNER_INSTALLED', join_paths(prefix, helpers_install_dir, 'gst-plugin-scanner'))
 cdata.set_quoted('GST_PTP_HELPER_INSTALLED', join_paths(prefix, helpers_install_dir, 'gst-ptp-helper'))
+cdata.set_quoted('GST_PLUGIN_SCANNER_SUBDIR', libexecdir,
+  description: 'libexecdir path component, used to find plugin-scanner on relocatable builds on windows')
 
 if gst_version_nano > 0
     # Have GST_ERROR message printed when running from git
@@ -318,8 +331,7 @@ 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
 
@@ -374,7 +386,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')
@@ -398,7 +409,7 @@ if bashcomp_found
   pkgconfig = find_program('pkg-config')
 
   runcmd = run_command(pkgconfig,
-      '--define-variable=prefix="."',
+      '--define-variable=prefix=.',
       '--variable=completionsdir',
       'bash-completion')
 
@@ -410,7 +421,7 @@ if bashcomp_found
   endif
 
   runcmd = run_command(pkgconfig,
-      '--define-variable=prefix="."',
+      '--define-variable=prefix=.',
       '--variable=helpersdir',
       'bash-completion')
 
@@ -428,9 +439,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'