forked from NVIDIA/stdexec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
60 lines (50 loc) · 1.61 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
from conan import ConanFile
from conan.tools.build.cppstd import check_min_cppstd
from conan.tools.cmake import CMake, cmake_layout
from conan.tools.files import copy
from conan.tools.scm import Git
class StdexecPackage(ConanFile):
name = "p2300"
description = "std::execution"
author = "Michał Dominiak, Lewis Baker, Lee Howes, Kirk Shoop, Michael Garland, Eric Niebler, Bryce Adelstein Lelbach"
topics = ("WG21", "concurrency")
homepage = "https://github.com/NVIDIA/stdexec"
url = "https://github.com/NVIDIA/stdexec"
license = "Apache 2.0"
settings = "os", "arch", "compiler", "build_type"
exports_sources = (
"include/*",
"src/*",
"test/*",
"examples/*",
"cmake/*",
"CMakeLists.txt"
)
generators = "CMakeToolchain"
def validate(self):
check_min_cppstd(self, "20")
def set_version(self):
if not self.version:
git = Git(self, self.recipe_folder)
self.version = git.get_commit()
def layout(self):
cmake_layout(self)
def build(self):
tests = "OFF" if self.conf.get("tools.build:skip_test", default=False) else "ON"
cmake = CMake(self)
cmake.configure(variables={
"STDEXEC_BUILD_TESTS": tests,
"STDEXEC_BUILD_EXAMPLES": tests,
})
cmake.build()
cmake.test()
def package_id(self):
# Clear settings because this package is header-only.
self.info.clear()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.set_property("cmake_file_name", "P2300")
self.cpp_info.set_property("cmake_target_name", "P2300::P2300")
self.cpp_info.libs = ["system_context"]