X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=subprojects%2Fgst-plugins-bad%2Fmeson.build;h=e1854b795f6098ab0f42c9758fb1d648df26654e;hb=ecd471f5ea4645102b206a43d863f0f0fe7d04ec;hp=7cab556e0c2b34b3aa0c4a1889c40aabcc1cc374;hpb=43c69ab2019b5ceed771649447ac38ca39121796;p=platform%2Fupstream%2Fgstreamer.git diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index 7cab556..e1854b7 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -1,6 +1,6 @@ project('gst-plugins-bad', 'c', 'cpp', - version : '1.19.2', - meson_version : '>= 0.54', + version : '1.22.3', + meson_version : '>= 0.62', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ]) @@ -14,11 +14,17 @@ gst_version_micro = version_arr[2].to_int() else gst_version_nano = 0 endif -gst_version_is_dev = gst_version_minor % 2 == 1 and gst_version_micro < 90 +gst_version_is_stable = gst_version_minor.is_even() +gst_version_is_dev = gst_version_minor.is_odd() and gst_version_micro < 90 -glib_req = '>= 2.56.0' +glib_req = '>= 2.62.0' orc_req = '>= 0.4.17' -gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor) + +if gst_version_is_stable + gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor) +else + gst_req = '>= ' + gst_version +endif api_version = '1.0' soversion = 0 @@ -29,7 +35,9 @@ libversion = '@0@.@1@.0'.format(soversion, curversion) osxversion = curversion + 1 plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0') +static_build = get_option('default_library') == 'static' plugins = [] +gst_libraries = [] cc = meson.get_compiler('c') cxx = meson.get_compiler('cpp') @@ -44,6 +52,7 @@ else endif cdata = configuration_data() +cdata.set('ENABLE_NLS', 1) if cc.get_id() == 'msvc' msvc_args = [ @@ -55,13 +64,29 @@ 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) + '/wd5051', # attribute 'attribute-name' requires at least 'standard-level'; ignored cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8 - - # Enable some warnings on MSVC to match GCC/Clang behaviour - '/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled - '/w14101', # 'identifier' : unreferenced local variable - '/w14189', # 'identifier' : local variable is initialized but not referenced ] + + if gst_version_is_dev + # Enable some warnings on MSVC to match GCC/Clang behaviour + msvc_args += cc.get_supported_arguments([ + '/we4002', # too many actual parameters for macro 'identifier' + '/we4003', # not enough actual parameters for macro 'identifier' + '/we4013', # 'function' undefined; assuming extern returning int + '/we4020', # 'function' : too many actual parameters + '/we4027', # function declared without formal parameter list + '/we4029', # declared formal parameter list different from definition + '/we4033', # 'function' must return a value + '/we4045', # 'array' : array bounds overflow + '/we4047', # 'operator' : 'identifier1' differs in levels of indirection from 'identifier2' + '/we4053', # one void operand for '?:' + '/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled + '/we4098', # 'function' : void function returning a value + '/we4101', # 'identifier' : unreferenced local variable + '/we4189', # 'identifier' : local variable is initialized but not referenced + ]) + endif add_project_arguments(msvc_args, language: ['c', 'cpp']) # Disable SAFESEH with MSVC for plugins and libs that use external deps that # are built with MinGW @@ -78,23 +103,24 @@ if cc.has_link_argument('-Wl,-Bsymbolic-functions') add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c') endif +# glib doesn't support unloading, which means that unloading and reloading +# any library that registers static types will fail +if cc.has_link_argument('-Wl,-z,nodelete') + add_project_link_arguments('-Wl,-z,nodelete', language: 'c') +endif +if cxx.has_link_argument('-Wl,-z,nodelete') + add_project_link_arguments('-Wl,-z,nodelete', language: 'cpp') +endif + # Symbol visibility -if cc.get_id() == 'msvc' - export_define = '__declspec(dllexport) extern' -elif cc.has_argument('-fvisibility=hidden') +if cc.has_argument('-fvisibility=hidden') add_project_arguments('-fvisibility=hidden', language: 'c') add_project_arguments('-fvisibility=hidden', language: 'cpp') if have_objc add_project_arguments('-fvisibility=hidden', language: 'objc') endif - export_define = 'extern __attribute__ ((visibility ("default")))' -else - export_define = 'extern' endif -# Passing this through the command line would be too messy -cdata.set('GST_API_EXPORT', export_define) - # Disable strict aliasing if cc.has_argument('-fno-strict-aliasing') add_project_arguments('-fno-strict-aliasing', language: 'c') @@ -211,7 +237,6 @@ warning_flags = [ warning_c_flags = [ '-Wmissing-prototypes', - '-Wdeclaration-after-statement', '-Wold-style-definition', ] @@ -313,9 +338,9 @@ gstglegl_dep = dependency('', required : false) if gstgl_dep.found() if gstgl_dep.type_name() == 'pkgconfig' - gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis').split() - gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys').split() - gst_gl_platforms = gstgl_dep.get_pkgconfig_variable('gl_platforms').split() + gst_gl_apis = gstgl_dep.get_variable('gl_apis').split() + gst_gl_winsys = gstgl_dep.get_variable('gl_winsys').split() + gst_gl_platforms = gstgl_dep.get_variable('gl_platforms').split() else gstbase = subproject('gst-plugins-base') gst_gl_apis = gstbase.get_variable('enabled_gl_apis') @@ -358,9 +383,8 @@ if gstgl_dep.found() endif libm = cc.find_library('m', required : false) -glib_dep = dependency('glib-2.0', version : glib_req, fallback: ['glib', 'libglib_dep']) -gmodule_dep = dependency('gmodule-2.0', fallback: ['glib', 'libgmodule_dep']) -gio_dep = dependency('gio-2.0', fallback: ['glib', 'libgio_dep']) +gio_dep = dependency('gio-2.0', version: glib_req) +gmodule_dep = dependency('gmodule-no-export-2.0') # gio-unix-2.0 is used by sys/bluez # Optional dep of ext/gl and gst/librfb @@ -369,8 +393,39 @@ if x11_dep.found() cdata.set('HAVE_X11', 1) endif +# +# Solaris and Illumos distros split a lot of networking-related code +# into '-lsocket -lnsl'. Anything that calls socketpair(), getifaddr(), +# etc. probably needs to include network_deps +# +if host_machine.system() == 'sunos' + network_deps = [ + cc.find_library('socket', required: false), + cc.find_library('nsl', required: false) + ] +else + network_deps = [] +endif + if host_machine.system() == 'windows' winsock2 = [cc.find_library('ws2_32')] + + building_for_win7 = cc.compiles('''#include + #ifndef WINVER + #error "unknown minimum supported OS version" + #endif + #if (WINVER < _WIN32_WINNT_WIN7) + #error "Windows 7 API is not guaranteed" + #endif + ''', + name: 'building for Windows 7') + + if not building_for_win7 + add_project_arguments([ + '-D_WIN32_WINNT=_WIN32_WINNT_WIN7', + '-DWINVER=_WIN32_WINNT_WIN7', + ], language: ['c', 'cpp']) + endif else winsock2 = [] endif @@ -470,7 +525,6 @@ pkgconfig_variables = ['exec_prefix=${prefix}', 'toolsdir=${exec_prefix}/bin', 'pluginsdir=${libdir}/gstreamer-1.0', 'datarootdir=${prefix}/share', - 'datadir=${datarootdir}', 'girdir=${datadir}/gir-1.0', 'typelibdir=${libdir}/girepository-1.0'] @@ -484,6 +538,8 @@ pkgconfig.generate( description : 'Streaming media framework, bad plugins libraries', ) +gpl_allowed = get_option('gpl').allowed() + subdir('gst-libs') subdir('gst') subdir('sys') @@ -510,14 +566,13 @@ if have_orcc ] endforeach - if meson.version().version_compare('>= 0.52') and orc_update_targets.length() > 0 + if orc_update_targets.length() > 0 update_orc_dist_target = alias_target('update-orc-dist', orc_update_targets) endif endif # xgettext is optional (on Windows for instance) if find_program('xgettext', required : get_option('nls')).found() - cdata.set('ENABLE_NLS', 1) subdir('po') endif @@ -526,38 +581,37 @@ subdir('scripts') # Set release date if gst_version_nano == 0 extract_release_date = find_program('scripts/extract-release-date-from-doap-file.py') - run_result = run_command(extract_release_date, gst_version, files('gst-plugins-bad.doap')) - if run_result.returncode() == 0 - release_date = run_result.stdout().strip() - cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', release_date) - message('Package release date: ' + release_date) - else - # Error out if our release can't be found in the .doap file - error(run_result.stderr()) - endif + run_result = run_command(extract_release_date, gst_version, files('gst-plugins-bad.doap'), check: true) + release_date = run_result.stdout().strip() + cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', release_date) + message('Package release date: ' + release_date) endif -if glib_dep.version().version_compare('< 2.67.4') +if gio_dep.version().version_compare('< 2.67.4') cdata.set('g_memdup2(ptr,sz)', '(G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL)') endif configure_file(output : 'config.h', configuration : cdata) -run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') +meson.add_dist_script('scripts/gen-changelog.py', meson.project_name(), '1.20.0', meson.project_version()) subdir('docs') -if meson.version().version_compare('>= 0.54') - plugin_names = [] - foreach plugin: plugins - # FIXME: Use str.subtring() when we can depend on Meson 0.56 - split = plugin.name().split('gst') - if split.length() == 2 - plugin_names += [split[1]] - else - warning('Need substring API in meson >= 0.56 to properly parse plugin name: ' + plugin.name()) - plugin_names += [plugin.name()] - endif - endforeach - summary({'Plugins':plugin_names}, list_sep: ', ') -endif +plugin_names = [] +gst_plugins = [] +foreach plugin: plugins + pkgconfig.generate(plugin, install_dir: plugins_pkgconfig_install_dir) + dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()}) + meson.override_dependency(plugin.name(), dep) + gst_plugins += [dep] + if plugin.name().startswith('gst') + plugin_names += [plugin.name().substring(3)] + else + plugin_names += [plugin.name()] + endif +endforeach + +summary({ + 'Plugins': plugin_names, + '(A)GPL license allowed': gpl_allowed, +}, list_sep: ', ')