-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
67 lines (54 loc) · 1.96 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
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
class SkyeConan(ConanFile):
name = "skye"
description = "Skye is an HTTP server framework for C++20."
homepage = "https://github.com/luketokheim/skye"
license = "BSL-1.0"
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
exports_sources = "CMakeLists.txt", "cmake/*", "include/*"
no_copy_source = True
options = {
"developer_mode": [True, False],
"enable_arch": [True, False],
"enable_benchmarks": [True, False],
"enable_io_uring": [True, False]
}
default_options = {
"developer_mode": False,
"enable_arch": False,
"enable_benchmarks": False,
"enable_io_uring": False
}
def requirements(self):
self.requires("boost/[>=1.79]",
options={"header_only": True},
transitive_headers=True)
self.requires("fmt/9.1.0")
def build_requirements(self):
if not self.options.developer_mode:
return
if self.options.enable_benchmarks:
self.test_requires("benchmark/1.7.1")
if not self.conf.get("tools.build:skip_test", default=False):
self.test_requires("catch2/3.3.2")
self.test_requires("sqlite3/3.41.1")
def layout(self):
cmake_layout(self)
def build(self):
variables = dict()
if self.options.developer_mode:
variables["skye_DEVELOPER_MODE"] = True
if self.options.enable_arch:
variables["ENABLE_ARCH"] = True
if self.options.enable_benchmarks:
variables["ENABLE_BENCHMARKS"] = True
if self.options.enable_io_uring:
variables["ENABLE_IO_URING"] = True
cmake = CMake(self)
cmake.configure(variables=variables)
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()