-
Notifications
You must be signed in to change notification settings - Fork 24
/
conanfile.py
57 lines (50 loc) · 2.12 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
from conans import ConanFile, CMake
import os
class BackwardCpp(ConanFile):
settings = 'os', 'compiler', 'build_type', 'arch'
name = 'backward'
url = 'https://github.com/bombela/backward-cpp'
license = 'MIT'
version = '1.3.0'
options = {
'stack_walking_unwind': [True, False],
'stack_walking_backtrace': [True, False],
'stack_details_auto_detect': [True, False],
'stack_details_backtrace_symbol': [True, False],
'stack_details_dw': [True, False],
'stack_details_bfd': [True, False],
'shared': [True, False]
}
default_options = (
'stack_walking_unwind=True',
'stack_walking_backtrace=False',
'stack_details_auto_detect=True',
'stack_details_backtrace_symbol=False',
'stack_details_dw=False',
'stack_details_bfd=False',
'shared=False'
)
exports = 'backward.cpp', 'backward.hpp', 'test/*', 'CMakeLists.txt', 'BackwardConfig.cmake'
generators = 'cmake'
def cmake_option(self, option, prefix = ''):
return '-D{}{}={}'.format(prefix, option.upper(), getattr(self.options, option))
def build(self):
cmake = CMake(self.settings)
options = ''
options += self.cmake_option('stack_walking_unwind')
options += self.cmake_option('stack_walking_backtrace')
options += self.cmake_option('stack_details_auto_detect')
options += self.cmake_option('stack_details_backtrace_symbol')
options += self.cmake_option('stack_details_dw')
options += self.cmake_option('stack_details_bfd')
options += self.cmake_option('shared', prefix = 'BACKWARD_')
self.run('cmake {} {} {} -DBACKWARD_TESTS=OFF'.format(self.conanfile_directory, cmake.command_line, options))
self.run('cmake --build . {}'.format(cmake.build_config))
def package(self):
self.copy('backward.hpp', os.path.join('include', 'backward'))
self.copy('*.a', dst='lib')
self.copy('*.so', dst='lib')
self.copy('*.lib', dst='lib')
self.copy('*.dll', dst='lib')
def package_info(self):
self.cpp_info.libs = ['backward']