build: Support tools with multiple translation units
Change-Id: I95c7ec4c0923e59b2652c6bba4ed2c0f00aa71da Refs: #2344
This commit is contained in:
1 parent
49343f6fab
commit
262203b644
2 files changed
+39
-18
No files matched your search
@@ -0,0 +1,38 @@
|
||||
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
||||
|
||||
from waflib import Utils, Context
|
||||
|
||||
top = '..'
|
||||
|
||||
def build(bld):
|
||||
# List all .cpp files (whole tool should be in one .cpp)
|
||||
for i in bld.path.ant_glob(['*.cpp']):
|
||||
name = str(i)[:-len(".cpp")]
|
||||
bld(features=['cxx', 'cxxprogram'],
|
||||
target="../bin/%s" % name,
|
||||
source=[i] + bld.path.ant_glob(['%s/**/*.cpp' % name]),
|
||||
use='ndn-cxx core-objects LIBRESOLV BOOST'
|
||||
)
|
||||
|
||||
# List all directories files (tool can has multiple .cpp in the directory)
|
||||
for name in bld.path.ant_glob(['*'], dir=True, src=False):
|
||||
srcFiles = bld.path.ant_glob(['%s/**/*.cpp' % name])
|
||||
if len(srcFiles) > 0:
|
||||
bld(features=['cxx', 'cxxprogram'],
|
||||
target="../bin/%s" % name,
|
||||
source=srcFiles,
|
||||
use='ndn-cxx core-objects LIBRESOLV BOOST',
|
||||
includes='%s' % name,
|
||||
)
|
||||
|
||||
bld(features="subst",
|
||||
source=bld.path.ant_glob(['*.sh', '*.py']),
|
||||
target=['../bin/%s' % node.change_ext('')
|
||||
for node in bld.path.ant_glob(['*.sh', '*.py'])],
|
||||
install_path="${BINDIR}",
|
||||
chmod=Utils.O755,
|
||||
VERSION=Context.g_module.VERSION
|
||||
)
|
||||
|
||||
bld.install_files("${DATAROOTDIR}/ndn",
|
||||
bld.path.ant_glob('nfd-status-http-server-files/*'))
|
||||
@@ -198,13 +198,7 @@ def build(bld):
|
||||
use='rib-objects',
|
||||
)
|
||||
|
||||
for app in bld.path.ant_glob('tools/*.cpp'):
|
||||
bld(features=['cxx', 'cxxprogram'],
|
||||
target='bin/%s' % (str(app.change_ext(''))),
|
||||
source=['tools/%s' % (str(app))],
|
||||
use='core-objects LIBRESOLV',
|
||||
)
|
||||
|
||||
bld.recurse("tools")
|
||||
bld.recurse("tests")
|
||||
|
||||
bld(features="subst",
|
||||
@@ -223,17 +217,6 @@ def build(bld):
|
||||
install_path="${MANDIR}/",
|
||||
VERSION=VERSION)
|
||||
|
||||
for script in bld.path.ant_glob(['tools/*.sh', 'tools/*.py']):
|
||||
bld(features='subst',
|
||||
source='tools/%s' % (str(script)),
|
||||
target='bin/%s' % (str(script.change_ext(''))),
|
||||
install_path="${BINDIR}",
|
||||
chmod=Utils.O755,
|
||||
VERSION=VERSION)
|
||||
|
||||
bld.install_files("${DATAROOTDIR}/ndn",
|
||||
bld.path.ant_glob('tools/nfd-status-http-server-files/*'))
|
||||
|
||||
def docs(bld):
|
||||
from waflib import Options
|
||||
Options.commands = ['doxygen', 'sphinx'] + Options.commands
|
||||
|
||||
Reference in new issue
Block a user