blob: 443bf495c586bcf9590bf44f0bd899e698413f95 [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):
Alexander Afanasyev87c9b5d2012-03-07 17:23:21 -08007 opt.add_option('--no-debug',action='store_true',default=False,dest='no_debug',help='''Make an optimized build of the library (remove debugging code)''')
Alexander Afanasyeve76f2632012-03-05 00:18:42 -08008 opt.load('compiler_c')
9 opt.load('compiler_cxx')
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080010 opt.load('boost')
11 opt.load('doxygen')
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080012 opt.load('ccnx tinyxml', tooldir=["waf-tools"])
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -080013
Alexander Afanasyev8f25cbb2012-03-01 23:53:40 -080014def configure(conf):
Alexander Afanasyeve76f2632012-03-05 00:18:42 -080015 conf.load("compiler_cxx")
Alexander Afanasyev8f25cbb2012-03-01 23:53:40 -080016 conf.check_cfg(atleast_pkgconfig_version='0.20')
17 conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL')
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080018 # conf.check_cfg(package='libxml-2.0', args=['--cflags', '--libs'], uselib_store='XML')
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -080019
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080020 conf.load('boost')
Chaoyi Bianee5b8842012-03-07 13:43:27 -080021 conf.check_boost(lib='system iostreams test thread')
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080022
23 conf.load('doxygen')
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080024 conf.load('ccnx tinyxml')
25 conf.check_ccnx (path=conf.options.ccnx_dir)
26 conf.check_tinyxml (path=conf.options.ccnx_dir)
Alexander Afanasyeve76f2632012-03-05 00:18:42 -080027
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080028 conf.define ('STANDALONE', 1)
Alexander Afanasyev87c9b5d2012-03-07 17:23:21 -080029 if not conf.options.no_debug:
30 conf.define ('_DEBUG', 1)
Alexander Afanasyev250a4c42012-03-07 13:40:18 -080031
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -080032def build (bld):
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080033 bld.shlib (target=APPNAME,
34 features=['cxx', 'cxxshlib'],
35 source = bld.path.ant_glob(['model/sync-*.cc',
36 'helper/sync-*.cc']),
Chaoyi Bianee5b8842012-03-07 13:43:27 -080037 uselib = 'BOOST BOOST_IOSTREAMS BOOST_THREAD SSL TINYXML CCNX'
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080038 )
Alexander Afanasyevec1d4a72012-03-05 11:06:54 -080039
Alexander Afanasyev150f14d2012-03-05 21:24:49 -080040 # Unit tests
Alexander Afanasyev1fbdcdd2012-03-05 23:14:33 -080041 bld.program (target="unit-tests",
Alexander Afanasyev150f14d2012-03-05 21:24:49 -080042 source = bld.path.ant_glob(['test/**/*.cc']),
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080043 features=['cxx', 'cxxprogram'],
Alexander Afanasyevb71beab2012-03-05 21:13:49 -080044 use = 'BOOST_TEST sync')
Alexander Afanasyeve76f2632012-03-05 00:18:42 -080045
Alexander Afanasyev150f14d2012-03-05 21:24:49 -080046
47# doxygen docs
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080048from waflib.Build import BuildContext
49class doxy (BuildContext):
50 cmd = "doxygen"
51 fun = "doxygen"
Alexander Afanasyev7a696fb2012-03-01 17:17:22 -080052
Alexander Afanasyev182fdc22012-03-05 18:06:52 -080053def doxygen (bld):
54 bld (features="doxygen",
55 doxyfile='doc/doxygen.conf',
56 output_dir = 'doc')