From aa86d56c4ed5970fa7ee3298d2fb1aae5b09c2ea Mon Sep 17 00:00:00 2001 From: Eric Riff Date: Mon, 12 Jul 2021 19:17:16 -0300 Subject: [PATCH] Add minimum compiler version check / raise. --- recipes/sentry-native/all/conanfile.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/recipes/sentry-native/all/conanfile.py b/recipes/sentry-native/all/conanfile.py index 0126ea7a70db7..86649540e2dd5 100644 --- a/recipes/sentry-native/all/conanfile.py +++ b/recipes/sentry-native/all/conanfile.py @@ -44,6 +44,15 @@ class SentryNativeConan(ConanFile): def _source_subfolder(self): return "source_subfolder" + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "gcc": "5", + "clang": "3.4", + "apple-clang": "5.1", + } + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -72,6 +81,14 @@ def configure(self): del self.options.fPIC if self.settings.compiler.cppstd: tools.check_min_cppstd(self, 14) + + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warn("Compiler is unknown. Assuming it supports C++14.") + elif tools.Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("Build requires support for C++14. Minimum version for {} is {}" + .format(str(self.settings.compiler), minimum_version)) + if self.options.backend == "inproc" and self.settings.os == "Windows" and tools.Version(self.version) < "0.4": raise ConanInvalidConfiguration("The in-process backend is not supported on Windows") if self.options.backend != "crashpad":