[glib] meson: only add -fno-strict-aliasing if supported by compiler



commit b241e3a5cc4b474a9711e7e8f455e8af41df1eb3
Author: Tim-Philipp Müller <tim centricular com>
Date:   Wed Jan 10 16:59:46 2018 +0000

    meson: only add -fno-strict-aliasing if supported by compiler
    
    Fixes warning spam on MSVC builds.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791622

 meson.build |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/meson.build b/meson.build
index 9b2cddc..f42ecbb 100644
--- a/meson.build
+++ b/meson.build
@@ -65,7 +65,9 @@ add_project_arguments('-D_GNU_SOURCE', language: 'c')
 
 # Disable strict aliasing;
 # see https://bugzilla.gnome.org/show_bug.cgi?id=791622
-add_project_arguments('-fno-strict-aliasing', language: 'c')
+if cc.has_argument('-fno-strict-aliasing')
+  add_project_arguments('-fno-strict-aliasing', language: 'c')
+endif
 
 ########################
 # Configuration begins #


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]