Skip to content

Commit

Permalink
Add minimum compiler version check / raise.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericriff committed Jul 12, 2021
1 parent d5f9952 commit aa86d56
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions recipes/sentry-native/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit aa86d56

Please sign in to comment.