-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwscript
More file actions
79 lines (54 loc) · 2.34 KB
/
wscript
File metadata and controls
79 lines (54 loc) · 2.34 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
#!/usr/bin/env python
import os.path as osp
from waflib.Utils import to_list
TOP = '.'
APPNAME = 'WireCell'
def find_submodules(ctx):
sms = list()
for wb in ctx.path.ant_glob("**/wscript_build"):
sms.append(wb.parent.name)
sms.sort()
return sms
def options(opt):
opt.load('boost')
opt.load("wcb",tooldir="waftools")
def configure(cfg):
cfg.load('boost')
cfg.load("wcb", tooldir="waftools")
# application specific requirements
cfg.check_boost(lib='system filesystem graph thread program_options iostreams regex')
#cfg.check_cxx(header_name="boost/pipeline.hpp", use='BOOST',
# define_name='BOOST_PIPELINE', mandatory=False)
cfg.check(header_name="dlfcn.h", uselib_store='DYNAMO',
lib=['dl'], mandatory=True)
cfg.check(features='cxx cxxprogram', lib=['pthread'], uselib_store='PTHREAD')
# boost 1.59 uses auto_ptr and GCC 5 deprecates it vociferously.
cfg.env.CXXFLAGS += ['-Wno-deprecated-declarations']
cfg.env.CXXFLAGS += to_list(cfg.options.build_debug)
cfg.env.CXXFLAGS += ['-DEIGEN_FFTW_DEFAULT=1']
cfg.env.CXXFLAGS += ['-Wall', '-Wno-unused-local-typedefs', '-Wno-unused-function']
cfg.env.CXXFLAGS += ['-Wpedantic', '-Werror']
# fixme: needed by cnpy in WireCellUtil. should make this an explicit dependency
cfg.env.LIB += ['z']
submodules = find_submodules(cfg)
# submodules = 'util iface gen sigproc img pgraph apps sio dfp tbb ress cfg root'.split()
# submodules.sort()
# submodules = [sm for sm in submodules if osp.isdir(sm)]
if 'BOOST_PIPELINE=1' not in cfg.env.DEFINES and 'dfp' in submodules:
print ('Removing submodule "dfp" due to lack of external')
submodules.remove('dfp')
# Remove WCT packages that happen to have same name as external name
for pkg,ext in dict(root="ROOTSYS", tbb="TBB", cuda="CUDA").items():
have='HAVE_'+ext
if have in cfg.env:
continue
if pkg in submodules:
print ('Removing package "%s" due to lack of external dependency'%pkg)
submodules.remove(pkg)
cfg.env.SUBDIRS = submodules
print ('Configured for submodules: %s' % (', '.join(submodules), ))
def build(bld):
bld.load('smplpkgs')
subdirs = bld.env.SUBDIRS
print ('Building: %s' % (', '.join(subdirs), ))
bld.recurse(subdirs)