-
-
Notifications
You must be signed in to change notification settings - Fork 447
/
conanfile.py
55 lines (47 loc) · 1.63 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
from conan import ConanFile
from conan.tools.files import copy
from os import path
class Chatterino(ConanFile):
name = "Chatterino"
requires = "boost/1.83.0"
settings = "os", "compiler", "build_type", "arch"
default_options = {
"with_benchmark": False,
"with_openssl3": True,
"openssl*:shared": True,
"boost*:header_only": True,
}
options = {
"with_benchmark": [True, False],
# Qt is built with OpenSSL 3 from version 6.5.0 onwards
"with_openssl3": [True, False],
}
generators = "CMakeDeps", "CMakeToolchain"
def requirements(self):
if self.options.get_safe("with_benchmark", False):
self.requires("benchmark/1.7.1")
if self.options.get_safe("with_openssl3", False):
self.requires("openssl/3.2.0")
else:
self.requires("openssl/1.1.1t")
def generate(self):
def copy_bin(dep, selector, subdir):
src = path.realpath(dep.cpp_info.bindirs[0])
dst = path.realpath(path.join(self.build_folder, subdir))
if src == dst:
return
copy(self, selector, src, dst, keep_path=False)
for dep in self.dependencies.values():
# macOS
copy_bin(dep, "*.dylib", "bin")
# Windows
copy_bin(dep, "*.dll", "bin")
copy_bin(dep, "*.dll", "Chatterino2") # used in CI
# Linux
copy(
self,
"*.so*",
dep.cpp_info.libdirs[0],
path.join(self.build_folder, "bin"),
keep_path=False,
)