From: Tim-Philipp Müller Date: Tue, 30 Jan 2018 20:34:52 +0000 (+0000) Subject: meson: use -fno-strict-aliasing where supported X-Git-Tag: 1.19.3~505^2~159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4007aaf3a7953a9002b4921f25de62a36d3daae5;p=platform%2Fupstream%2Fgstreamer.git meson: use -fno-strict-aliasing where supported https://bugzilla.gnome.org/show_bug.cgi?id=769183 --- diff --git a/ext/sidplay/meson.build b/ext/sidplay/meson.build index 6310da7..7781938 100644 --- a/ext/sidplay/meson.build +++ b/ext/sidplay/meson.build @@ -1,11 +1,13 @@ # sidplay plugin works with libsidplay 1.36.x (not 2.x.x) have_sidplay = false if add_languages('cpp') + extra_args = [] cxx = meson.get_compiler('cpp') if cxx.has_argument('-fvisibility=hidden') - cxx_vis_args = ['-fvisibility=hidden'] - else - cxx_vis_args = [] + extra_args += ['-fvisibility=hidden'] + endif + if cxx.has_argument('-fno-strict-aliasing') + extra_args += ['-fno-strict-aliasing'] endif if cxx.has_header('sidplay/player.h') @@ -22,7 +24,7 @@ endif if have_sidplay shared_module('gstsid', 'gstsiddec.cc', - cpp_args : ugly_args + cxx_vis_args, + cpp_args : ugly_args + extra_args, include_directories : [configinc], dependencies : [gstaudio_dep, sidplay_dep], install : true, diff --git a/meson.build b/meson.build index eb96b7b..72e785a 100644 --- a/meson.build +++ b/meson.build @@ -47,6 +47,11 @@ if cc.has_argument('-fvisibility=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() check_headers = [ ['HAVE_DLFCN_H', 'dlfcn.h'],