-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
176 lines (150 loc) · 8.3 KB
/
Copy pathconanfile.py
File metadata and controls
176 lines (150 loc) · 8.3 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
from conan.tools.files import rmdir
import os
required_conan_version = ">=2.0"
class LibAeonConan(ConanFile):
name = 'libaeon'
description = 'A general purpose C++20 support library.'
license = 'BSD-2-Clause'
homepage = 'https://git.aeons.dev/aeon-engine/libaeon'
url = 'https://git.aeons.dev/aeon-engine/libaeon'
settings = "os", "compiler", "build_type", "arch"
options = {
'shared': [True, False],
'fPIC': [True, False],
'libaeon_enable_unittests': [True, False],
'libaeon_enable_benchmarks': [True, False],
'libaeon_with_common': [True, False],
'libaeon_with_compression': [True, False],
'libaeon_with_crypto': [True, False],
'libaeon_with_file_container': [True, False],
'libaeon_with_fonts': [True, False],
'libaeon_with_imaging': [True, False],
'libaeon_with_logger': [True, False],
'libaeon_with_math': [True, False],
'libaeon_with_platform': [True, False],
'libaeon_with_platform_glfw': [True, False],
'libaeon_with_platform_sdl2': [True, False],
'libaeon_with_plugins': [True, False],
'libaeon_with_ptree': [True, False],
'libaeon_with_rdp': [True, False],
'libaeon_with_reflection': [True, False],
'libaeon_with_serial': [True, False],
'libaeon_with_sockets': [True, False],
'libaeon_with_streams': [True, False],
'libaeon_with_testing': [True, False],
'libaeon_with_tracelog': [True, False],
'libaeon_with_unicode': [True, False],
'libaeon_with_variant': [True, False],
'libaeon_with_vulkan': [True, False],
'libaeon_with_web': [True, False]
}
default_options = {
'shared': False,
'fPIC': True,
'libaeon_enable_unittests': True,
'libaeon_enable_benchmarks': True,
'libaeon_with_common': True,
'libaeon_with_compression': True,
'libaeon_with_crypto': True,
'libaeon_with_file_container': True,
'libaeon_with_fonts': True,
'libaeon_with_imaging': True,
'libaeon_with_logger': True,
'libaeon_with_math': True,
'libaeon_with_platform': True,
'libaeon_with_platform_glfw': True,
'libaeon_with_platform_sdl2': True,
'libaeon_with_plugins': True,
'libaeon_with_ptree': True,
'libaeon_with_rdp': True,
'libaeon_with_reflection': True,
'libaeon_with_serial': True,
'libaeon_with_sockets': True,
'libaeon_with_streams': True,
'libaeon_with_testing': True,
'libaeon_with_tracelog': True,
'libaeon_with_unicode': True,
'libaeon_with_variant': True,
'libaeon_with_vulkan': True,
'libaeon_with_web': True
}
def configure(self):
if self.options.shared:
del self.options.fPIC
if not self.options.libaeon_with_platform:
del self.options.libaeon_with_platform_glfw
del self.options.libaeon_with_platform_sdl2
def config_options(self):
if self.settings.os == 'Windows':
del self.options.fPIC
if self.settings.os == 'Macos' or self.settings.os == 'iOS':
del self.options.libaeon_with_serial
del self.options.libaeon_with_vulkan
def requirements(self):
if self.options.get_safe('libaeon_enable_unittests', False):
self.requires('gtest/1.14.0@aleya/public')
if self.options.get_safe('libaeon_enable_benchmarks', False):
self.requires('benchmark/1.8.3@aleya/public')
if self.options.get_safe('libaeon_with_compression', False):
self.requires('zlib/1.3.0@aleya/public')
if self.options.get_safe('libaeon_with_fonts', False):
self.requires('freetype/2.13.2@aleya/public')
if self.options.get_safe('libaeon_with_imaging', False):
self.requires('libpng/1.6.40@aleya/public')
self.requires('libjpeg-turbo/3.0.1@aleya/public')
if self.options.get_safe('libaeon_with_platform', False) and self.options.get_safe('libaeon_with_platform_glfw',
False):
self.requires('glfw/3.3.9@aleya/public')
if self.options.get_safe('libaeon_with_platform', False) and self.options.get_safe('libaeon_with_platform_sdl2',
False):
self.requires('sdl/2.28.5@aleya/public')
if self.options.get_safe('libaeon_with_sockets', False):
self.requires('asio/1.29.0@aleya/public')
if self.options.get_safe('libaeon_with_vulkan', False):
self.requires('vulkan-memory-allocator/3.0.1@aleya/public')
def generate(self):
tc = CMakeToolchain(self)
tc.variables['BUILD_SHARED_LIBS'] = self.options.shared
tc.variables['CMAKE_POSITION_INDEPENDENT_CODE'] = \
self.options.get_safe('fPIC', default=False) or self.options.shared
tc.variables['AEON_libaeon_enable_TESTING'] = self.options.libaeon_enable_unittests
tc.variables['AEON_libaeon_enable_BENCHMARK'] = self.options.libaeon_enable_benchmarks
tc.variables['AEON_COMPONENT_COMMON'] = self.options.get_safe('libaeon_with_common', default=False)
tc.variables['AEON_COMPONENT_COMPRESSION'] = self.options.get_safe('libaeon_with_compression', default=False)
tc.variables['AEON_COMPONENT_CRYPTO'] = self.options.get_safe('libaeon_with_crypto', default=False)
tc.variables['AEON_COMPONENT_FILE_CONTAINER'] = self.options.get_safe('libaeon_with_file_container',
default=False)
tc.variables['AEON_COMPONENT_FONTS'] = self.options.get_safe('libaeon_with_fonts', default=False)
tc.variables['AEON_COMPONENT_IMAGING'] = self.options.get_safe('libaeon_with_imaging', default=False)
tc.variables['AEON_COMPONENT_LOGGER'] = self.options.get_safe('libaeon_with_logger', default=False)
tc.variables['AEON_COMPONENT_MATH'] = self.options.get_safe('libaeon_with_math', default=False)
tc.variables['AEON_COMPONENT_PLATFORM'] = self.options.get_safe('libaeon_with_platform', default=False)
tc.variables['AEON_COMPONENT_PLUGINS'] = self.options.get_safe('libaeon_with_plugins', default=False)
tc.variables['AEON_COMPONENT_PTREE'] = self.options.get_safe('libaeon_with_ptree', default=False)
tc.variables['AEON_COMPONENT_RDP'] = self.options.get_safe('libaeon_with_rdp', default=False)
tc.variables['AEON_COMPONENT_REFLECTION'] = self.options.get_safe('libaeon_with_reflection', default=False)
tc.variables['AEON_COMPONENT_SERIAL'] = self.options.get_safe('libaeon_with_serial', default=False)
tc.variables['AEON_COMPONENT_SOCKETS'] = self.options.get_safe('libaeon_with_sockets', default=False)
tc.variables['AEON_COMPONENT_STREAMS'] = self.options.get_safe('libaeon_with_streams', default=False)
tc.variables['AEON_COMPONENT_TESTING'] = self.options.get_safe('libaeon_with_testing', default=False)
tc.variables['AEON_COMPONENT_TRACELOG'] = self.options.get_safe('libaeon_with_tracelog', default=False)
tc.variables['AEON_COMPONENT_UNICODE'] = self.options.get_safe('libaeon_with_unicode', default=False)
tc.variables['AEON_COMPONENT_VARIANT'] = self.options.get_safe('libaeon_with_variant', default=False)
tc.variables['AEON_COMPONENT_VULKAN'] = self.options.get_safe('libaeon_with_vulkan', default=False)
tc.variables['AEON_COMPONENT_WEB'] = self.options.get_safe('libaeon_with_web', default=False)
tc.variables['AEON_PLATFORM_BACKEND_GLFW'] = self.options.get_safe('libaeon_with_platform_glfw', default=False)
tc.variables['AEON_PLATFORM_BACKEND_SDL2'] = self.options.get_safe('libaeon_with_platform_sdl2', default=False)
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
tools.remove_files_by_mask(self.package_folder, "*.pdb")
tools.remove_files_by_mask(self.package_folder, "*.exe")