-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
46 lines (39 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
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
from conan.tools.files import copy
class GTProxyRecipe(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps"
default_options = {
"libressl*:shared": True
}
def requirements(self):
self.requires("cpp-httplib/[~0.12]")
self.requires("fmt/8.1.1")
if self.settings.os != "Android":
self.requires("libressl/[~3.5]")
else:
self.requires("openssl/3.2.0")
self.requires("magic_enum/[~0.8]")
self.requires("nlohmann_json/[~3.11]")
self.requires("pcg-cpp/cci.20210406")
self.requires("spdlog/1.10.0")
self.requires("sigslot/1.2.2")
def layout(self):
cmake_layout(self)
def generate(self):
for dep in self.dependencies.values():
if dep.cpp_info.bindirs:
if self.settings.os == "Linux" or self.settings.os == "Android":
copy(self, "*.so", dep.cpp_info.bindirs[0], self.build_folder)
elif self.settings.os == "Windows":
copy(self, "*.dll", dep.cpp_info.bindirs[0], self.build_folder)
if dep.cpp_info.libdirs:
if self.settings.os == "Linux" or self.settings.os == "Android":
copy(self, "*.a", dep.cpp_info.bindirs[0], self.build_folder)
elif self.settings.os == "Windows":
copy(self, "*.lib", dep.cpp_info.bindirs[0], self.build_folder)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()