aboutsummaryrefslogtreecommitdiffstats
path: root/meson
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-06-28 19:31:55 -0400
committerDavid Robillard <d@drobilla.net>2022-06-28 19:32:01 -0400
commit38b97f3c6dd626e963f4a031da77be2e71427091 (patch)
treefc75946543e44aeecc17b8b8a8b6bfc0a823620d /meson
parent452ac347e549c74bf9cd41c89f5b2bf6510b50a1 (diff)
downloadpugl-38b97f3c6dd626e963f4a031da77be2e71427091.tar.gz
pugl-38b97f3c6dd626e963f4a031da77be2e71427091.tar.bz2
pugl-38b97f3c6dd626e963f4a031da77be2e71427091.zip
Clean up meson configuration
Diffstat (limited to 'meson')
-rw-r--r--meson/warnings/meson.build32
1 files changed, 28 insertions, 4 deletions
diff --git a/meson/warnings/meson.build b/meson/warnings/meson.build
index 8973b7a..ffb5907 100644
--- a/meson/warnings/meson.build
+++ b/meson/warnings/meson.build
@@ -29,6 +29,10 @@
# Wtrampolines
# Wvla-larger-than=BYTES
#
+# Build specific:
+#
+# Wpoison-system-directories
+#
# C Specific:
#
# Wc11-c2x-compat
@@ -121,11 +125,16 @@ gcc_common_warnings = [
'-Wwrite-strings',
]
-# Set all_c_warnings for the current C compiler
+#####
+# C #
+#####
+
if is_variable('cc') and not is_variable('all_c_warnings')
all_c_warnings = []
+
if cc.get_id() == 'clang'
all_c_warnings += ['-Weverything']
+
elif cc.get_id() == 'gcc'
all_c_warnings += gcc_common_warnings + [
'-Wabsolute-value',
@@ -143,20 +152,28 @@ if is_variable('cc') and not is_variable('all_c_warnings')
'-Wstrict-prototypes',
'-Wunsuffixed-float-constants',
]
+
elif cc.get_id() == 'msvc'
all_c_warnings += ['/Wall']
endif
+
+ all_c_warnings = cc.get_supported_arguments(all_c_warnings)
endif
-# Set all_cpp_warnings for the current C++ compiler
-if is_variable('cpp') and not is_variable('all_cpp_warnings')
+#######
+# C++ #
+#######
+
+if is_variable('cpp')
all_cpp_warnings = []
+
if cpp.get_id() == 'clang'
all_cpp_warnings += [
'-Weverything',
'-Wno-c++98-compat',
'-Wno-c++98-compat-pedantic'
]
+
elif cpp.get_id() == 'gcc'
all_cpp_warnings += gcc_common_warnings + [
'-Wabi-tag',
@@ -199,19 +216,26 @@ if is_variable('cpp') and not is_variable('all_cpp_warnings')
'-Wvolatile',
'-Wzero-as-null-pointer-constant',
]
+
elif cpp.get_id() == 'msvc'
all_cpp_warnings += ['/Wall']
endif
+
+ all_cpp_warnings = cpp.get_supported_arguments(all_cpp_warnings)
endif
# Set all_objc_warnings for the current Objective C compiler
-if is_variable('objcc') and not is_variable('all_objc_warnings')
+if is_variable('objcc')
all_objc_warnings = []
+
if objcc.get_id() == 'clang'
all_objc_warnings += ['-Weverything']
+
elif objc.get_id() == 'gcc'
all_objc_warnings += gcc_common_warnings + [
'-Wno-direct-ivar-access',
]
endif
+
+ all_objc_warnings = objcc.get_supported_arguments(all_objc_warnings)
endif