-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
75 lines (57 loc) · 1.75 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
71
72
73
74
75
import os
from conan import ConanFile
from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout
from conan.tools.build import check_max_cppstd, check_min_cppstd
class libsbx_recipe(ConanFile):
name = "aoc23"
version = "0.1.0"
# Metadata
license = "MIT"
author = "Jonas Kabelitz <[email protected]>"
# Binary configuration
settings = (
"os",
"compiler",
"build_type",
"arch"
)
options = {
"fPIC": [True, False],
}
default_options = {
"fPIC": True,
}
def config_options(self):
if self.settings.os == "Windows":
self.options.fPIC = False
def layout(self):
cmake_layout(self)
# Define custom layout for build artifacts
is_compiler_multi_config = self.settings.compiler == "msvc"
self.folders.build = "build"
if not is_compiler_multi_config:
self.folders.build = os.path.join(self.folders.build, str(self.settings.build_type).lower())
self.folders.generators = os.path.join(self.folders.build, "dependencies")
def requirements(self):
self.requires("fmt/10.0.0")
self.requires("range-v3/0.12.0")
def generate(self):
deps = CMakeDeps(self)
toolchain = CMakeToolchain(self)
deps.generate()
toolchain.generate()
def build(self):
cmake = CMake(self)
variables = {
"SBX_BUILD_DEMO": "On" if self.options.build_demo else "Off",
"SBX_BUILD_SHARED": "On" if self.options.shared else "Off",
"SBX_BUILD_TESTS": "On" if self.options.build_tests else "Off"
}
cmake.configure(variables)
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.components["core"].libs = ["core"]
self.cpp_info.components["core"].includedirs = ["include"]