This repository has been archived by the owner on Apr 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
/
wscript
136 lines (100 loc) · 3.95 KB
/
wscript
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
#!/usr/bin/env python
import os
import subprocess
import waflib.Logs as Logs, waflib.Options as Options
import string
VERSION = 'xxx'
APPNAME = 'non-things'
top = '.'
out = 'build'
common = [ 'nonlib', 'FL' ]
projects = [ 'timeline', 'mixer', 'sequencer', 'session-manager' ]
def options(opt):
# opt.add_option('--use-system-ntk', action='store_true', default=False,
# dest='use_system_ntk',
# help="Link to system-installed shared NTK instead of bundled version")
opt.add_option('--enable-debug', action='store_true', default=False, dest='debug',
help='Build for debugging')
opt.add_option('--project', action='store', default=False, dest='project',
help='Limit build to a single project (' + ', '.join( projects ) + ')')
for i in projects:
opt.recurse(i)
def configure(conf):
conf.load('compiler_c')
conf.load('compiler_cxx')
conf.load('gnu_dirs')
conf.load('ntk_fluid')
conf.line_just = 52
optimization_flags = [
"-O3",
"-fomit-frame-pointer",
"-ffast-math",
# "-fstrength-reduce",
"-pipe"
]
debug_flags = [ '-g' ]
if Options.options.debug:
conf.env.append_value('CFLAGS', debug_flags )
conf.env.append_value('CXXFLAGS', debug_flags )
else:
conf.env.append_value('CFLAGS', optimization_flags )
conf.env.append_value('CXXFLAGS', optimization_flags )
conf.define( 'NDEBUG', 1 )
conf.define( "_GNU_SOURCE", 1)
conf.env.append_value('CFLAGS',['-Wall'])
# conf.env.append_value('CXXFLAGS',['-Wall','-fno-exceptions', '-fno-rtti'])
conf.env.append_value('CXXFLAGS',['-Wall','-fno-rtti'])
global_flags = [ '-pthread',
'-D_LARGEFILE64_SOURCE',
'-D_FILE_OFFSET_BITS=64',
'-D_GNU_SOURCE' ]
conf.env.append_value('CFLAGS', global_flags )
conf.env.append_value('CXXFLAGS', global_flags )
conf.env['LIB_PTHREAD'] = ['pthread']
conf.env['LIB_DL'] = ['dl']
conf.env['LIB_M'] = ['m']
# NTK_EXTRA_FLAGS=''
# if not Options.options.use_system_ntk:
# print 'Using bundled NTK'
# os.environ['PKG_CONFIG_PATH'] = 'lib/ntk/build/:' + os.environ.get('PKG_CONFIG_PATH','')
# NTK_EXTRA_FLAGS='--static'
# PWD = os.environ.get('PWD','')
# os.environ['PATH'] = PWD + '/lib/ntk/build/fluid:' + os.environ.get('PATH','')
conf.check_cfg(package='ntk', uselib_store='NTK', args='--cflags --libs',
atleast_version='1.3.0', mandatory=True)
conf.check_cfg(package='ntk_images', uselib_store='NTK_IMAGES', args=' --cflags --libs',
atleast_version='1.3.0', mandatory=True)
conf.find_program('ntk-fluid', var='NTK_FLUID')
conf.check_cfg(package='jack', uselib_store='JACK', args="--cflags --libs",
atleast_version='0.103.0', mandatory=True)
conf.check_cfg(package='xpm', uselib_store='XMP',args="--cflags --libs",
atleast_version='2.0.0', mandatory=True)
conf.check_cfg(package='liblo', uselib_store='LIBLO',args="--cflags --libs",
atleast_version='0.26', mandatory=True)
###
for i in common:
conf.recurse(i)
conf.env.PROJECT = conf.options.project
if conf.env.PROJECT:
pl = [ conf.env.PROJECT ]
else:
pl = projects;
for i in pl:
Logs.pprint('YELLOW', 'Configuring %s' % i)
conf.recurse(i);
def run(ctx):
if not Options.options.cmd:
Logs.error("missing --cmd option for run command")
return
cmd = Options.options.cmd
Logs.pprint('GREEN', 'Running %s' % cmd)
subprocess.call(cmd, shell=True, env=source_tree_env())
def build(bld):
for i in common:
bld.recurse(i)
if bld.env.PROJECT:
pl = [ bld.env.PROJECT ]
else:
pl = projects;
for i in pl:
bld.recurse(i);