|
@@ -0,0 +1,60 @@
|
|
|
|
+#! /usr/bin/env python
|
|
|
|
+# encoding: utf-8
|
|
|
|
+# Thomas Nagy, 2006-2010 (ita)
|
|
|
|
+
|
|
|
|
+# the following two variables are used by the target "waf dist"
|
|
|
|
+VERSION='0.0.1'
|
|
|
|
+APPNAME='cxx_test'
|
|
|
|
+
|
|
|
|
+# these variables are mandatory ('/' are converted automatically)
|
|
|
|
+top = '.'
|
|
|
|
+out = 'debug'
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+from functools import partial
|
|
|
|
+from pathlib import Path
|
|
|
|
+
|
|
|
|
+def get_sub_files(obj, suffixes=(".c", ".cpp", ".cxx"), max_depth=None):
|
|
|
|
+ root = Path(str(obj.path))
|
|
|
|
+ if root.is_file():
|
|
|
|
+ root = root.parent
|
|
|
|
+
|
|
|
|
+ queue = [(0, root)]
|
|
|
|
+ ret = []
|
|
|
|
+
|
|
|
|
+ while queue:
|
|
|
|
+ depth, curr = queue.pop()
|
|
|
|
+ if max_depth is not None and depth>max_depth: continue
|
|
|
|
+ for file in curr.iterdir():
|
|
|
|
+ if file.is_file():
|
|
|
|
+ if not suffixes or file.name.endswith(suffixes):
|
|
|
|
+ ret.append(str(file.relative_to(root)))
|
|
|
|
+ elif file.is_dir():
|
|
|
|
+ queue.append((depth+1, file))
|
|
|
|
+
|
|
|
|
+ return ret
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def options(opt):
|
|
|
|
+ opt.load('compiler_cxx')
|
|
|
|
+
|
|
|
|
+def configure(conf):
|
|
|
|
+ conf.load('compiler_cxx')
|
|
|
|
+ conf.env.append_value('CXXFLAGS', '-g')
|
|
|
|
+ conf.check(header_name='stdio.h', features='cxx cxxprogram', mandatory=False)
|
|
|
|
+
|
|
|
|
+def build(bld):
|
|
|
|
+ bld.get_sub_files = partial(get_sub_files, bld)
|
|
|
|
+ bld.recurse("src/common")
|
|
|
|
+ bld.recurse("src/core")
|
|
|
|
+ bld.recurse("src/fft")
|
|
|
|
+ bld.recurse("src/io")
|
|
|
|
+ bld.recurse("src/plugins")
|
|
|
|
+ bld.program(target=APPNAME,
|
|
|
|
+ features='cxx cxxprogram',
|
|
|
|
+ lib=['fftw3', "sndfile"],
|
|
|
|
+ use=["common", "fft", "io"])
|
|
|
|
+
|
|
|
|
+
|