-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
64 lines (54 loc) · 1.93 KB
/
conanfile.py
File metadata and controls
64 lines (54 loc) · 1.93 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
59
60
61
62
63
64
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
class StackUtilsConan(ConanFile):
name = "stack_utils"
version = "1.0.0"
license = "MIT"
author = "Your Name <your.email@example.com>"
url = "https://github.com/yourusername/stack_utils"
description = "Modern C++ lock-free stack implementation"
topics = ("cpp", "lock-free", "concurrent", "data-structures")
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False],
"build_tests": [True, False],
"build_benchmarks": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"build_tests": True,
"build_benchmarks": False,
}
exports_sources = "CMakeLists.txt", "src/*", "include/*", "cmake/*", "tests/*"
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def layout(self):
cmake_layout(self)
def requirements(self):
# Add dependencies here if needed
pass
def build_requirements(self):
if self.options.build_tests:
self.test_requires("gtest/1.14.0")
if self.options.build_benchmarks:
self.test_requires("benchmark/1.8.3")
def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.variables["STACK_UTILS_BUILD_TESTS"] = self.options.build_tests
tc.variables["STACK_UTILS_BUILD_BENCHMARKS"] = self.options.build_benchmarks
tc.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 = ["stack_utils"]
self.cpp_info.set_property("cmake_target_name", "stack_utils::stack_utils")