[vte] build: Check gcc version



commit 15c45ca13f3a3f2e048c392fd7f3bf276b709649
Author: Christian Persch <chpe src gnome org>
Date:   Mon Apr 15 20:26:19 2019 +0200

    build: Check gcc version
    
    Apparently earlier gcc versions claim to support the -std flag for C++17
    but don't actually support C++17 fully.
    
    Ideally, meson would check that the compiler actually supports the standard,
    not just the -std flag, but until then, implement a simple version check
    based on https://gcc.gnu.org/projects/cxx-status.html#cxx17
    
    https://gitlab.gnome.org/GNOME/vte/issues/110

 meson.build | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/meson.build b/meson.build
index 90e8f838..233477e7 100644
--- a/meson.build
+++ b/meson.build
@@ -209,6 +209,14 @@ endforeach
 assert(get_option('c_std') == 'gnu11', 'cannot override C std version')
 assert(get_option('cpp_std') == 'gnu++17', 'cannot override C++ std version')
 
+# Meson only checks that -std supports the given string, but *not* that
+# the compiler really supports that C++ standard version. Do a simple version
+# check based on https://gcc.gnu.org/projects/cxx-status.html#cxx17
+
+if cxx.get_id() == 'gcc'
+  assert(cxx.version().version_compare('>= 7.0'), 'needs G++ >= 7 for C++17 support')
+endif
+
 # Compiler flags
 
 compiler_flags_common = [


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]