improve conan compiler version check

This commit is contained in:
Neargye 2020-01-31 14:04:09 +05:00
parent ef959f7da5
commit 1303731a6b

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from conans import ConanFile from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration from conans.errors import ConanInvalidConfiguration
class NameofConan(ConanFile): class NameofConan(ConanFile):
@ -29,7 +29,7 @@ class NameofConan(ConanFile):
@property @property
def supported_compiler(self): def supported_compiler(self):
compiler = str(self.settings.compiler) compiler = str(self.settings.compiler)
version = str(self.settings.compiler.version) version = tools.Version(self.settings.compiler.version)
if compiler == "Visual Studio" and version >= "15": if compiler == "Visual Studio" and version >= "15":
return True return True
if compiler == "gcc" and version >= "7": if compiler == "gcc" and version >= "7":