-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconanfile.py
More file actions
57 lines (44 loc) · 1.96 KB
/
conanfile.py
File metadata and controls
57 lines (44 loc) · 1.96 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
from conans import ConanFile, CMake, tools
import re
from os import path
class StructuredConcurrencyExampleRecipe(ConanFile):
name = "structured_concurrency_example"
description = "example code for using structure concurrency with senders/receivers"
author = "Lucian Radu Teodorescu"
topics = ("C++", "concurrency")
homepage = "https://github.com/lucteo/structured_concurrency_example"
url = "https://github.com/lucteo/structured_concurrency_example"
license = "MIT License"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
build_policy = "missing" # Some of the dependencies don't have builds for all our targets
options = {"shared": [True, False], "fPIC": [True, False], "with_profiling": [True, False]}
default_options = {"shared": False, "fPIC": True, "with_profiling": False}
exports_sources = ("include/*", "CMakeLists.txt")
def set_version(self):
self.version = "0.1.0"
def build_requirements(self):
# TODO: for some reason these doesn't work
# self.build_requires("libcurl/7.80.0")
# self.build_requires("opencv/4.5.3")
if self.options.with_profiling:
self.build_requires("tracy-interface/0.1.0")
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def build(self):
# Note: options "shared" and "fPIC" are automatically handled in CMake
cmake = self._configure_cmake()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package_info(self):
self.cpp_info.libs = self.collect_libs()
def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["structured_concurrency_example.with_profiling"] = self.options.with_profiling
if self.settings.compiler == "Visual Studio" and self.options.shared:
cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True
cmake.configure(source_folder=None)
return cmake