aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
Diffstat (limited to 'wscript')
-rw-r--r--wscript78
1 files changed, 78 insertions, 0 deletions
diff --git a/wscript b/wscript
new file mode 100644
index 0000000..c85a8d7
--- /dev/null
+++ b/wscript
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+import os
+import subprocess
+
+from waflib.extras import autowaf as autowaf
+
+# Version of this package (even if built as a child)
+MACHINA_VERSION = '0.5.0'
+
+# Variables for 'waf dist'
+APPNAME = 'machina'
+VERSION = MACHINA_VERSION
+
+# Mandatory variables
+top = '.'
+out = 'build'
+
+def options(opt):
+ opt.load('compiler_cxx')
+ autowaf.set_options(opt)
+
+def configure(conf):
+ autowaf.display_header('Machina Configuration')
+ conf.load('compiler_cxx', cache=True)
+ conf.load('autowaf', cache=True)
+ autowaf.set_cxx_lang(conf, 'c++11')
+
+ autowaf.check_pkg(conf, 'lv2', uselib_store='LV2',
+ atleast_version='1.2.0', mandatory=True)
+ autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM',
+ atleast_version='2.14.0', mandatory=True)
+ autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
+ atleast_version='2.14.0', mandatory=True)
+ autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
+ atleast_version='2.12.0', mandatory=False)
+ autowaf.check_pkg(conf, 'jack', uselib_store='JACK',
+ atleast_version='0.120.0', mandatory=True)
+ autowaf.check_pkg(conf, 'raul', uselib_store='RAUL',
+ atleast_version='0.8.9', mandatory=True)
+ autowaf.check_pkg(conf, 'ganv-1', uselib_store='GANV',
+ atleast_version='1.2.1', mandatory=False)
+ autowaf.check_pkg(conf, 'serd-0', uselib_store='SERD',
+ atleast_version='0.4.0', mandatory=False)
+ autowaf.check_pkg(conf, 'sord-0', uselib_store='SORD',
+ atleast_version='0.4.0', mandatory=False)
+ autowaf.check_pkg(conf, 'eugene', uselib_store='EUGENE',
+ atleast_version='0.0.0', mandatory=False)
+
+ # Check for posix_memalign (OSX, amazingly, doesn't have it)
+ autowaf.check_function(conf, 'cxx', 'posix_memalign',
+ header_name = 'stdlib.h',
+ define_name = 'HAVE_POSIX_MEMALIGN',
+ mandatory = False)
+
+ if conf.env.HAVE_GTKMM and conf.env.HAVE_GANV:
+ autowaf.define(conf, 'MACHINA_BUILD_GUI', 1)
+
+ autowaf.define(conf, 'MACHINA_PPQN', 19200)
+ autowaf.define(conf, 'MACHINA_VERSION', MACHINA_VERSION)
+ autowaf.define(conf, 'MACHINA_DATA_DIR',
+ os.path.join(conf.env.DATADIR, 'machina'))
+
+ conf.write_config_header('machina_config.h', remove=False)
+
+ autowaf.display_summary(conf)
+ autowaf.display_msg(conf, "Jack", bool(conf.env.HAVE_JACK))
+ autowaf.display_msg(conf, "GUI", bool(conf.env.MACHINA_BUILD_GUI))
+ print('')
+
+def build(bld):
+ bld.recurse('src/engine')
+ bld.recurse('src/client')
+
+ if bld.env.MACHINA_BUILD_GUI:
+ bld.recurse('src/gui')
+
+def lint(ctx):
+ subprocess.call('cpplint.py --filter=-whitespace/comments,-whitespace/tab,-whitespace/braces,-whitespace/labels,-build/header_guard,-readability/casting,-readability/todo,-build/namespaces,-whitespace/line_length,-runtime/rtti,-runtime/references,-whitespace/blank_line,-runtime/sizeof,-readability/streams,-whitespace/operators,-whitespace/parens,-build/include,-build/storage_class `find -name *.cpp -or -name *.hpp`', shell=True)