From f98278c0b8658a53eafbadf1b7a9eacd266aee0c Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 20 Oct 2021 15:27:16 +0800 Subject: meson.build: Force-include msvc_recommended_pragmas.h ...on Visual Studio builds. We can get rid of lots of compiler noise with that header, which we are free to use since we are always using GLib. Also, define _GNU_SOURCE when we are not using Visual Studio. --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e4051877a..4cb771aaa 100644 --- a/meson.build +++ b/meson.build @@ -28,7 +28,13 @@ clutter_libversion = '@0@.@1@.@2@'.format(clutter_so_age, clutter_binary_age, cl cc = meson.get_compiler('c') config_h = configuration_data() -add_project_arguments([ '-D_GNU_SOURCE', '-DHAVE_CONFIG_H' ], language: 'c') +add_project_arguments(['-DHAVE_CONFIG_H' ], language: 'c') + +if cc.get_id() == 'msvc' + add_project_arguments([ '-FImsvc_recommended_pragmas.h' ], language: 'c') +else + add_project_arguments([ '-D_GNU_SOURCE' ], language: 'c') +endif # Paths clutter_prefix = get_option('prefix') -- cgit v1.2.1