blob: 3d4799eb6403544c7f78448016fa0aa445a2ad90 [file] [log] [blame]
Obaid2ea377f2014-02-27 19:45:15 -06001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3from waflib import Build, Logs, Utils, Task, TaskGen, Configure
4import os
5
6def options(opt):
7 opt.load('compiler_cxx gnu_dirs')
8 opt.load('flags boost doxygen coverage', tooldir=['.waf-tools'])
9
10 nrdopt = opt.add_option_group('NRD Options')
11 nrdopt.add_option('--debug',action='store_true',default=False,dest='debug',help='''Compile library debugging mode without all optimizations (-O0)''')
12 nrdopt.add_option('--with-tests', action='store_true',default=False,dest='with_tests',help='''Build unit tests''')
13
14def configure(conf):
15 conf.load("compiler_cxx gnu_dirs boost flags")
16
17 conf.check_cfg(package='libndn-cpp-dev', args=['--cflags', '--libs'], uselib_store='NDN_CPP', mandatory=True)
18
19 boost_libs='system'
20 if conf.options.with_tests:
21 conf.env['WITH_TESTS'] = 1
22 conf.define('WITH_TESTS', 1);
23 boost_libs+=' unit_test_framework'
24
25 conf.check_boost(lib=boost_libs)
26 if conf.env.BOOST_VERSION_NUMBER < 104800:
27 Logs.error ("Minimum required boost version is 1.48")
28 Logs.error ("Please upgrade your distribution or install custom boost libraries" +
29 " (http://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)")
30 return
31
32 # conf.load('coverage')
33
34 # try:
35 # conf.load('doxygen')
36 # except:
37 # pass
38
39 conf.write_config_header('config.hpp')
40
41def build (bld):
42 bld (
43 features=['cxx', 'cxxprogram'],
44 target="nrd",
45 source = bld.path.ant_glob('*.cpp'),
46 use = 'NDN_CPP BOOST',
47 )
48