-
Notifications
You must be signed in to change notification settings - Fork 202
/
SConscript
90 lines (64 loc) · 2.29 KB
/
SConscript
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
"""
A SConscript file.
Builds everything.
"""
import os
import sys
Import('env')
env = env.Clone()
dirs = {
'root': Dir('.'),
'include': Dir('include'),
'lib': Dir('lib'),
'bin': Dir('bin'),
'man': Dir('man'),
}
env.Append(CPPPATH=[dirs['include']])
env.Append(LIBPATH=[dirs['lib']])
env.GenerateDefines(target=os.path.join('include', env.defines.defines_file_name), source=env.defines.template_file_path)
libraries = []
includes = []
for x in Glob('libs/*'):
sconscript_path = x.File('SConscript')
if sconscript_path.exists():
name = os.path.basename(str(x))
if not sys.platform.startswith('linux'):
if name in 'netlinkplus':
continue
if env.mongoose == 'no' and name in 'mongooseplus':
continue
if env.upnp == 'no' and name in 'miniupnpcplus':
continue
library, library_includes = SConscript(sconscript_path, exports='env dirs name')
libraries.extend(library)
includes.extend(library_includes)
apps = []
configurations = []
help = []
for x in Glob('apps/*'):
sconscript_path = x.File('SConscript')
if sconscript_path.exists():
name = os.path.basename(str(x))
app, configuration, help = SConscript(sconscript_path, exports='env dirs name')
apps.extend(app)
configurations.extend(configuration)
samples = []
if env.mode != 'retail':
for x in Glob('samples/*'):
libname = os.path.basename(str(x))
if not sys.platform.startswith('linux'):
if libname in 'netlinkplus':
continue
if libname in 'miniupnpcplus':
continue
for y in x.glob('*'):
sconscript_path = y.File('SConscript')
if sconscript_path.exists():
name = 'sample_%s_%s' % (libname, os.path.basename(str(y)))
sample = SConscript(sconscript_path, exports='env dirs name')
samples.extend(sample)
if env.mode == 'release':
samples.extend(env.SymLink(y.File(os.path.basename(str(y))).srcnode(), sample))
else:
samples.extend(env.SymLink(y.File('%sd' % os.path.basename(str(y))).srcnode(), sample))
Return('libraries includes apps samples configurations help')