Mesa (master): meson: merge C and C++ compiler arguments check

Eric Engeström eric_engestrom at kemper.freedesktop.org
Thu Mar 22 12:03:03 UTC 2018


Module: Mesa
Branch: master
Commit: cb2ddcefa5196fdfeff76f405175c7a6c110eae4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb2ddcefa5196fdfeff76f405175c7a6c110eae4

Author: Eric Engestrom <eric.engestrom at imgtec.com>
Date:   Mon Mar 12 14:54:50 2018 +0000

meson: merge C and C++ compiler arguments check

Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

---

 meson.build | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/meson.build b/meson.build
index 871b0d8d22..6edb089db9 100644
--- a/meson.build
+++ b/meson.build
@@ -764,7 +764,9 @@ if ['linux', 'cygwin'].contains(host_machine.system())
   pre_args += '-D_GNU_SOURCE'
 endif
 
-# Check for generic C arguments
+# Check for generic C/C++ arguments
+cpp = meson.get_compiler('cpp')
+cpp_args = []
 c_args = []
 foreach a : ['-Wall', '-Werror=implicit-function-declaration',
              '-Werror=missing-prototypes', '-fno-math-errno',
@@ -772,22 +774,15 @@ foreach a : ['-Wall', '-Werror=implicit-function-declaration',
   if cc.has_argument(a)
     c_args += a
   endif
+  if cpp.has_argument(a)
+    cpp_args += a
+  endif
 endforeach
 c_vis_args = []
 if cc.has_argument('-fvisibility=hidden')
   c_vis_args += '-fvisibility=hidden'
 endif
 
-# Check for generic C++ arguments
-cpp = meson.get_compiler('cpp')
-cpp_args = []
-foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
-             '-Qunused-arguments']
-  if cpp.has_argument(a)
-    cpp_args += a
-  endif
-endforeach
-
 # For some reason, the test for -Wno-foo always succeeds with gcc, even if the
 # option is not supported. Hence, check for -Wfoo instead.
 if cpp.has_argument('-Wnon-virtual-dtor')




More information about the mesa-commit mailing list