Skip to content

Commit

Permalink
Check C++17 support (#2)
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <uilianries@gmail.com>
  • Loading branch information
uilianries authored and Ivan Kulikov committed Nov 15, 2019
1 parent f523f47 commit 7fff920
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions recipes/libsigcpp/3.0.0/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import os
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
from conans.tools import Version


class LibSigCppConan(ConanFile):
name = "libsigcpp"
Expand All @@ -23,6 +26,26 @@ def _source_subfolder(self):
def _build_subfolder(self):
return "build_subfolder"

@property
def _supported_cppstd(self):
return ["17", "gnu17", "20", "gnu20"]

def configure(self):
compiler_version = Version(self.settings.compiler.version)
if self.settings.compiler.cppstd and \
not self.settings.compiler.cppstd in self._supported_cppstd:
raise ConanInvalidConfiguration("This library requires c++17 standard or higher."
" {} required."
.format(self.settings.compiler.cppstd))
if (self.settings.compiler == "gcc" and compiler_version < "7") or \
(self.settings.compiler == "Visual Studio" and compiler_version < "15") or \
(self.settings.compiler == "clang" and compiler_version < "5") or \
(self.settings.compiler == "apple-clang" and compiler_version < "9"):
raise ConanInvalidConfiguration("This library requires C++17 or higher support standard."
" {} {} is not supported."
.format(self.settings.compiler,
self.settings.compiler.version))

def source(self):
tools.get(**self.conan_data["sources"][self.version])
extracted_dir = "libsigc++-" + self.version
Expand Down

0 comments on commit 7fff920

Please sign in to comment.