-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconanfile.py
More file actions
58 lines (47 loc) · 1.53 KB
/
conanfile.py
File metadata and controls
58 lines (47 loc) · 1.53 KB
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
from conan import ConanFile, tools
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import get
required_conan_version = ">=2.0.0"
class MptCryptoConan(ConanFile):
name = "mpt-crypto"
description = "MPT-Crypto: Cryptographic Primitives for Confidential Assets"
url = "https://github.com/XRPLF/mpt-crypto"
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
"tests": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"tests": False,
}
requires = [
"openssl/3.5.5",
"secp256k1/0.7.1",
]
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def layout(self):
cmake_layout(self, src_folder="src")
self.folders.generators = "build/generators"
def generate(self):
tc = CMakeToolchain(self)
tc.variables["ENABLE_TESTS"] = self.options.tests
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.libs = ["mpt-crypto"]
self.cpp_info.set_property("cmake_file_name", "mpt-crypto")
self.cpp_info.set_property("cmake_target_name", "mpt-crypto::mpt-crypto")