blob: 2403d3064110d5d24e1507598c6f85378b2f1eda [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2VERSION = "0.1.0"
3APPNAME = "ndncert"
4BUGREPORT = "http://redmine.named-data.net/projects/ndncert"
5GIT_TAG_PREFIX = "ndncert"
6
7from waflib import Logs, Utils, Context
8import os
9
10def options(opt):
11 opt.load(['compiler_cxx', 'gnu_dirs'])
12 opt.load(['boost', 'default-compiler-flags', 'sqlite3',
13 'coverage', 'sanitizers',
14 'doxygen', 'sphinx_build'], tooldir=['.waf-tools'])
15
16 syncopt = opt.add_option_group ("ndncert options")
17 syncopt.add_option('--with-tests', action='store_true', default=False, dest='with_tests',
18 help='''build unit tests''')
19
20def configure(conf):
21 conf.load(['compiler_cxx', 'gnu_dirs',
22 'boost', 'default-compiler-flags', 'sqlite3',
23 'doxygen', 'sphinx_build'])
24
25 if 'PKG_CONFIG_PATH' not in os.environ:
26 os.environ['PKG_CONFIG_PATH'] = Utils.subst_vars('${LIBDIR}/pkgconfig', conf.env)
27
28 conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
29 uselib_store='NDN_CXX', mandatory=True)
30
31 USED_BOOST_LIBS = ['system', 'filesystem', 'iostreams',
32 'program_options', 'thread', 'log', 'log_setup']
33
34 conf.env['WITH_TESTS'] = conf.options.with_tests
35 if conf.env['WITH_TESTS']:
36 USED_BOOST_LIBS += ['unit_test_framework']
37 conf.define('HAVE_TESTS', 1)
38
39 conf.check_boost(lib=USED_BOOST_LIBS, mt=True)
40 if conf.env.BOOST_VERSION_NUMBER < 105400:
41 Logs.error("Minimum required boost version is 1.54.0")
42 Logs.error("Please upgrade your distribution or install custom boost libraries" +
43 " (https://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)")
44 return
45
46 # Loading "late" to prevent tests to be compiled with profiling flags
47 conf.load('coverage')
48
49 conf.load('sanitizers')
Zhiyi Zhang65ba9322017-01-19 14:15:03 -080050
Zhiyi Zhang8617a792017-01-17 16:45:56 -080051 conf.write_config_header('src/ndncert-config.hpp')
52
53def build(bld):
54 core = bld(
55 target = "objects",
56 features=['cxx'],
57 source = bld.path.ant_glob(['src/**/*.cpp']),
58 use = 'NDN_CXX BOOST',
59 includes = ['src'],
60 export_includes=['src'],
61 )
62
63 bld.recurse('tests')