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

Dylan Baker dbaker at kemper.freedesktop.org
Thu Mar 22 18:46:00 UTC 2018


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

Author: Dylan Baker <dylan at pnwbakers.com>
Date:   Thu Mar 22 11:35:08 2018 -0700

Revert "meson: merge C and C++ compiler arguments check"

This reverts commit cb2ddcefa5196fdfeff76f405175c7a6c110eae4.

This causes clang to error out building C++ code. The plan is to fix the
build to work with clang, but in the mean time we'll just revert this

Signed-off-by: Dylan Baker <dylan.c.baker at intel.com>
Acked-by: Eric Engestrom <eric at engestrom.ch>

---

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

diff --git a/meson.build b/meson.build
index 6edb089db9..871b0d8d22 100644
--- a/meson.build
+++ b/meson.build
@@ -764,9 +764,7 @@ if ['linux', 'cygwin'].contains(host_machine.system())
   pre_args += '-D_GNU_SOURCE'
 endif
 
-# Check for generic C/C++ arguments
-cpp = meson.get_compiler('cpp')
-cpp_args = []
+# Check for generic C arguments
 c_args = []
 foreach a : ['-Wall', '-Werror=implicit-function-declaration',
              '-Werror=missing-prototypes', '-fno-math-errno',
@@ -774,15 +772,22 @@ 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