From 45b4a92eb8aec4b998c502bf51c2930bfc673edb Mon Sep 17 00:00:00 2001 From: Mathieu Giraud Date: Thu, 14 Sep 2017 08:42:02 +0200 Subject: [PATCH] vidjil.cpp: warns when clang or gcc is too old Closes #2631. --- algo/core/check-compiler.h | 13 +++++++++++++ algo/vidjil.cpp | 1 + 2 files changed, 14 insertions(+) create mode 100644 algo/core/check-compiler.h diff --git a/algo/core/check-compiler.h b/algo/core/check-compiler.h new file mode 100644 index 000000000..22fdeacde --- /dev/null +++ b/algo/core/check-compiler.h @@ -0,0 +1,13 @@ + + +// Check compiler + +#if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30300 + #warning "Vidjil needs a C++11 compiler such as clang >= 3.3 - see http://vidjil.org/doc/algo.html" + #endif +#elif defined(__GNUC__) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #warning "Vidjil needs a C++11 compiler such as gcc >= 4.8 - see http://vidjil.org/doc/algo.html" + #endif +#endif diff --git a/algo/vidjil.cpp b/algo/vidjil.cpp index 840d036ba..e447f40a9 100644 --- a/algo/vidjil.cpp +++ b/algo/vidjil.cpp @@ -35,6 +35,7 @@ #include #include +#include "core/check-compiler.h" #include "core/tools.h" #include "core/json.h" #include "core/germline.h" -- GitLab