-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
conanfile.py
70 lines (56 loc) · 2.21 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
67
68
69
70
import os
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
required_conan_version = ">=1.52.0"
class WilzegersAutotestConan(ConanFile):
name = "wilzegers-autotest"
description = "Autotest facilitates the testing of class interfaces"
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://gitlab.com/wilzegers/autotest"
topics = ("autotest", "testing", "header-only")
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True
@property
def _min_cppstd(self):
return 17
@property
def _compilers_minimum_version(self):
return {
"Visual Studio": "15",
"msvc": "191",
"gcc": "7",
"clang": "5.0",
"apple-clang": "9.1",
}
def layout(self):
basic_layout(self, src_folder="src")
def package_id(self):
self.info.clear()
def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
)
if self.settings.compiler != "clang":
raise ConanInvalidConfiguration("Only clang allowed")
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def package(self):
copy(self, "*.hpp",
src=os.path.join(self.source_folder, "autotest/include"),
dst=os.path.join(self.package_folder, "include"))
copy(self, "LICENSE",
dst=os.path.join(self.package_folder, "licenses"),
src=self.source_folder)
def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []