summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-07 16:30:48 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-17 09:11:18 +0100
commit28f155a5c6f7ef05923f3607f442ce3ebdac4740 (patch)
tree0fd96361087b04b4a33ec04ab494ce18eeace9cd
parent0d2b624f1e24240a1c4e651aa1cfe9a8dd10a573 (diff)
build: add warnings and compiler flags to meson
this moves meson and autotools closer to each other. The flags are selected in order to keep the amount of warnings low. Differential Revision: https://phab.enlightenment.org/D7429
-rw-r--r--meson.build16
1 files changed, 16 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index d3dfd54424..f85681c7cc 100644
--- a/meson.build
+++ b/meson.build
@@ -77,6 +77,22 @@ local_benchmark = join_paths('src', 'benchmarks')
77local_examples = join_paths('src', 'examples') 77local_examples = join_paths('src', 'examples')
78local_scripts = join_paths('src', 'scripts') 78local_scripts = join_paths('src', 'scripts')
79 79
80dev_cflags = []
81dev_cflags_try = [
82 '-fvisibility=hidden',
83 '-Wall',
84 '-Wsign-compare',
85 '-Wno-missing-field-initializers',
86]
87
88foreach cf: dev_cflags_try
89 if cc.has_argument(cf) == true
90 dev_cflags += cf
91 endif
92endforeach
93add_global_arguments(dev_cflags, language: 'c')
94
95
80foreach lang : ['c', 'objc', 'cpp'] 96foreach lang : ['c', 'objc', 'cpp']
81 add_global_arguments('-DHAVE_CONFIG_H=1', language: lang) 97 add_global_arguments('-DHAVE_CONFIG_H=1', language: lang)
82 add_global_arguments('-D_GNU_SOURCE=1', language: lang) 98 add_global_arguments('-D_GNU_SOURCE=1', language: lang)