autotools: include meson_get_version
[mesa.git] / meson.build
index 6edb089db90a03a4501c61b632c9aeb4a4ab6bd2..f210eeb25305dd66b6e6d1ebc736ad5886498fb8 100644 (file)
@@ -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')
@@ -911,8 +916,8 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
   pre_args += '-DMAJOR_IN_MKDEV'
 endif
 
-foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h']
-  if cc.compiles('#include <@0@>'.format(h), name : '@0@ works'.format(h))
+foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h']
+  if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h))
     pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
   endif
 endforeach