-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
conanfile.py
66 lines (52 loc) · 2.45 KB
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.33.0"
class PlatformInterfacesConan(ConanFile):
name = "platform.equality"
license = "LGPL-3.0-or-later"
homepage = "https://github.com/linksplatform/Equality"
url = "https://github.com/conan-io/conan-center-index"
description = "platform.delegates is one of the libraries of the LinksPlatform modular framework, " \
"which uses innovations from the C++20 standard, for slow parody any typing dictionary and others."
topics = ("linksplatform", "cpp20", "equality", "ranges", "any", "header-only")
settings = "compiler"
no_copy_source = True
@property
def _source_subfolder(self):
return "source_subfolder"
@property
def _internal_cpp_subfolder(self):
return os.path.join(self._source_subfolder, "cpp", "Platform.Equality")
@property
def _compilers_minimum_version(self):
return {
"gcc": "10",
"Visual Studio": "16",
"clang": "11",
"apple-clang": "11"
}
@property
def _minimum_cpp_standard(self):
return 20
def validate(self):
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler))
if not minimum_version:
self.output.warn("{} recipe lacks information about the {} compiler support.".format(
self.name, self.settings.compiler))
elif tools.Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration("platform.equality/{} "
"requires C++{} with {}, "
"which is not supported "
"by {} {}.".format(
self.version, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler,
self.settings.compiler.version))
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, self._minimum_cpp_standard)
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder)
def package(self):
self.copy("*.h", dst="include", src=self._internal_cpp_subfolder)
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
def package_id(self):
self.info.header_only()