Alexander Afanasyev | 7a696fb | 2012-03-01 17:17:22 -0800 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 3 | VERSION='0.0.1' |
| 4 | APPNAME='sync' |
| 5 | |
Alexander Afanasyev | e76f263 | 2012-03-05 00:18:42 -0800 | [diff] [blame] | 6 | def options(opt): |
| 7 | opt.load('compiler_c') |
| 8 | opt.load('compiler_cxx') |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 9 | opt.load('boost') |
| 10 | opt.load('doxygen') |
Alexander Afanasyev | 250a4c4 | 2012-03-07 13:40:18 -0800 | [diff] [blame] | 11 | opt.load('ccnx tinyxml', tooldir=["waf-tools"]) |
Alexander Afanasyev | 7a696fb | 2012-03-01 17:17:22 -0800 | [diff] [blame] | 12 | |
Alexander Afanasyev | 8f25cbb | 2012-03-01 23:53:40 -0800 | [diff] [blame] | 13 | def configure(conf): |
Alexander Afanasyev | e76f263 | 2012-03-05 00:18:42 -0800 | [diff] [blame] | 14 | conf.load("compiler_cxx") |
Alexander Afanasyev | 8f25cbb | 2012-03-01 23:53:40 -0800 | [diff] [blame] | 15 | conf.check_cfg(atleast_pkgconfig_version='0.20') |
| 16 | conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL') |
Alexander Afanasyev | 250a4c4 | 2012-03-07 13:40:18 -0800 | [diff] [blame] | 17 | # conf.check_cfg(package='libxml-2.0', args=['--cflags', '--libs'], uselib_store='XML') |
Alexander Afanasyev | 7a696fb | 2012-03-01 17:17:22 -0800 | [diff] [blame] | 18 | |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 19 | conf.load('boost') |
Chaoyi Bian | ee5b884 | 2012-03-07 13:43:27 -0800 | [diff] [blame] | 20 | conf.check_boost(lib='system iostreams test thread') |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 21 | |
| 22 | conf.load('doxygen') |
Alexander Afanasyev | 250a4c4 | 2012-03-07 13:40:18 -0800 | [diff] [blame] | 23 | conf.load('ccnx tinyxml') |
| 24 | conf.check_ccnx (path=conf.options.ccnx_dir) |
| 25 | conf.check_tinyxml (path=conf.options.ccnx_dir) |
Alexander Afanasyev | e76f263 | 2012-03-05 00:18:42 -0800 | [diff] [blame] | 26 | |
Alexander Afanasyev | 250a4c4 | 2012-03-07 13:40:18 -0800 | [diff] [blame] | 27 | conf.define ('STANDALONE', 1) |
| 28 | # conf.define ('DIGEST_BASE64', 1) # base64 is not working and probably will not work at all |
| 29 | |
Alexander Afanasyev | 7a696fb | 2012-03-01 17:17:22 -0800 | [diff] [blame] | 30 | def build (bld): |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 31 | bld.shlib (target=APPNAME, |
| 32 | features=['cxx', 'cxxshlib'], |
| 33 | source = bld.path.ant_glob(['model/sync-*.cc', |
| 34 | 'helper/sync-*.cc']), |
Chaoyi Bian | ee5b884 | 2012-03-07 13:43:27 -0800 | [diff] [blame] | 35 | uselib = 'BOOST BOOST_IOSTREAMS BOOST_THREAD SSL TINYXML CCNX' |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 36 | ) |
Alexander Afanasyev | ec1d4a7 | 2012-03-05 11:06:54 -0800 | [diff] [blame] | 37 | |
Alexander Afanasyev | 150f14d | 2012-03-05 21:24:49 -0800 | [diff] [blame] | 38 | # Unit tests |
Alexander Afanasyev | 1fbdcdd | 2012-03-05 23:14:33 -0800 | [diff] [blame] | 39 | bld.program (target="unit-tests", |
Alexander Afanasyev | 150f14d | 2012-03-05 21:24:49 -0800 | [diff] [blame] | 40 | source = bld.path.ant_glob(['test/**/*.cc']), |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 41 | features=['cxx', 'cxxprogram'], |
Alexander Afanasyev | b71beab | 2012-03-05 21:13:49 -0800 | [diff] [blame] | 42 | use = 'BOOST_TEST sync') |
Alexander Afanasyev | e76f263 | 2012-03-05 00:18:42 -0800 | [diff] [blame] | 43 | |
Alexander Afanasyev | 150f14d | 2012-03-05 21:24:49 -0800 | [diff] [blame] | 44 | |
| 45 | # doxygen docs |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 46 | from waflib.Build import BuildContext |
| 47 | class doxy (BuildContext): |
| 48 | cmd = "doxygen" |
| 49 | fun = "doxygen" |
Alexander Afanasyev | 7a696fb | 2012-03-01 17:17:22 -0800 | [diff] [blame] | 50 | |
Alexander Afanasyev | 182fdc2 | 2012-03-05 18:06:52 -0800 | [diff] [blame] | 51 | def doxygen (bld): |
| 52 | bld (features="doxygen", |
| 53 | doxyfile='doc/doxygen.conf', |
| 54 | output_dir = 'doc') |