blob: 9d9a879c3ac2cdff2dd93a6cdd6fb27806754471 [file] [log] [blame]
Junxiao Shif7191242015-03-19 05:53:41 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
Junxiao Shif7191242015-03-19 05:53:41 -07002
Alexander Afanasyev821a0142016-03-02 15:42:28 -08003VERSION = '0.2'
4APPNAME = 'ndn-tools'
5
6from waflib import Utils
7import os
Junxiao Shif7191242015-03-19 05:53:41 -07008
9def options(opt):
10 opt.load(['compiler_cxx', 'gnu_dirs'])
Shock Jiang0f0bc4b2015-06-22 15:11:30 -070011
Junxiao Shi2222a612015-06-06 08:01:38 -070012 opt.load(['default-compiler-flags', 'sphinx_build', 'boost'], tooldir=['.waf-tools'])
Junxiao Shi2713a3b2015-06-22 16:19:05 -070013 opt.add_option('--with-tests', action='store_true', default=False,
14 dest='with_tests', help='''Build unit tests''')
Shock Jiang0f0bc4b2015-06-22 15:11:30 -070015 opt.recurse("tools")
Junxiao Shif7191242015-03-19 05:53:41 -070016
17def configure(conf):
18 conf.load(['compiler_cxx', 'gnu_dirs',
Junxiao Shi2222a612015-06-06 08:01:38 -070019 'default-compiler-flags', 'sphinx_build', 'boost'])
Junxiao Shif7191242015-03-19 05:53:41 -070020
Alexander Afanasyev821a0142016-03-02 15:42:28 -080021 if 'PKG_CONFIG_PATH' not in os.environ:
22 os.environ['PKG_CONFIG_PATH'] = Utils.subst_vars('${LIBDIR}/pkgconfig', conf.env)
Junxiao Shif7191242015-03-19 05:53:41 -070023 conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
24 uselib_store='NDN_CXX', mandatory=True)
25
Junxiao Shi2713a3b2015-06-22 16:19:05 -070026 boost_libs = 'system iostreams regex'
27 if conf.options.with_tests:
28 conf.env['WITH_TESTS'] = 1
29 conf.define('WITH_TESTS', 1);
30 boost_libs += ' unit_test_framework'
31 conf.check_boost(lib=boost_libs)
Junxiao Shi2222a612015-06-06 08:01:38 -070032
Junxiao Shif7191242015-03-19 05:53:41 -070033 conf.recurse('tools')
34
35def build(bld):
Junxiao Shi2219a052015-05-28 02:53:48 -070036 bld.env['VERSION'] = VERSION
37
Junxiao Shif7191242015-03-19 05:53:41 -070038 bld(
39 target='core-objects',
40 name='core-objects',
41 features='cxx',
42 source=bld.path.ant_glob(['core/*.cpp']),
Junxiao Shi2713a3b2015-06-22 16:19:05 -070043 use='NDN_CXX BOOST',
Junxiao Shif7191242015-03-19 05:53:41 -070044 export_includes='.',
45 )
46
47 bld.recurse('tools')
Junxiao Shi2713a3b2015-06-22 16:19:05 -070048 bld.recurse('tests')
Junxiao Shi2219a052015-05-28 02:53:48 -070049 bld.recurse('manpages')