blob: 7f4f1b37b11d337eb9e0444160f487ddd0c37dba [file] [log] [blame]
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -08001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
Alexander Afanasyev182fdc22012-03-05 18:06:52 -08003VERSION='0.0.1'
4APPNAME='sync'
5
Alexander Afanasyeve76f2632012-03-05 00:18:42 -08006def options(opt):
7 opt.load('compiler_c')
8 opt.load('compiler_cxx')
Alexander Afanasyev182fdc22012-03-05 18:06:52 -08009 opt.load('boost')
10 opt.load('doxygen')
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080011 opt.load('ccnx tinyxml', tooldir=["waf-tools"])
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -080012
Alexander Afanasyev8f25cbb2012-03-01 23:53:40 -080013def configure(conf):
Alexander Afanasyeve76f2632012-03-05 00:18:42 -080014 conf.load("compiler_cxx")
Alexander Afanasyev8f25cbb2012-03-01 23:53:40 -080015 conf.check_cfg(atleast_pkgconfig_version='0.20')
16 conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL')
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080017 # conf.check_cfg(package='libxml-2.0', args=['--cflags', '--libs'], uselib_store='XML')
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -080018
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080019 conf.load('boost')
Chaoyi Bianee5b8842012-03-07 13:43:27 -080020 conf.check_boost(lib='system iostreams test thread')
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080021
22 conf.load('doxygen')
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080023 conf.load('ccnx tinyxml')
24 conf.check_ccnx (path=conf.options.ccnx_dir)
25 conf.check_tinyxml (path=conf.options.ccnx_dir)
Alexander Afanasyeve76f2632012-03-05 00:18:42 -080026
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080027 conf.define ('STANDALONE', 1)
28 # conf.define ('DIGEST_BASE64', 1) # base64 is not working and probably will not work at all
29
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -080030def build (bld):
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080031 bld.shlib (target=APPNAME,
32 features=['cxx', 'cxxshlib'],
33 source = bld.path.ant_glob(['model/sync-*.cc',
34 'helper/sync-*.cc']),
Chaoyi Bianee5b8842012-03-07 13:43:27 -080035 uselib = 'BOOST BOOST_IOSTREAMS BOOST_THREAD SSL TINYXML CCNX'
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080036 )
Alexander Afanasyevec1d4a72012-03-05 11:06:54 -080037
Alexander Afanasyev150f14d2012-03-05 21:24:49 -080038 # Unit tests
Alexander Afanasyev1fbdcdd2012-03-05 23:14:33 -080039 bld.program (target="unit-tests",
Alexander Afanasyev150f14d2012-03-05 21:24:49 -080040 source = bld.path.ant_glob(['test/**/*.cc']),
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080041 features=['cxx', 'cxxprogram'],
Alexander Afanasyevb71beab2012-03-05 21:13:49 -080042 use = 'BOOST_TEST sync')
Alexander Afanasyeve76f2632012-03-05 00:18:42 -080043
Alexander Afanasyev150f14d2012-03-05 21:24:49 -080044
45# doxygen docs
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080046from waflib.Build import BuildContext
47class doxy (BuildContext):
48 cmd = "doxygen"
49 fun = "doxygen"
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -080050
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080051def doxygen (bld):
52 bld (features="doxygen",
53 doxyfile='doc/doxygen.conf',
54 output_dir = 'doc')