# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

top = '..'

def build(bld):
    # Single object tools:
    # tools/example-tool.cpp is a self-contained tool with a main() function
    # and is built as build/bin/example-tool.
    # These tools cannot be unit-tested.
    for tool in bld.path.ant_glob('*.cpp'):
        name = tool.change_ext('').path_from(bld.path.get_bld())
        bld.program(name=name,
                    target='../bin/%s' % name,
                    source=[tool],
                    use='NDN_CXX libndn-nac')

    # Sub-directory tools:
    # tools/example-tool/**/*.cpp is compiled and linked into build/bin/example-tool.
    # tools/example-tool/main.cpp must exist and must contain the main() function.
    # All other objects are collected into 'tools-objects' and can be unit-tested.
    testableObjects = []
    for subdir in bld.path.ant_glob('*', dir=True, src=False):
        mainFile = subdir.find_node('main.cpp')
        if mainFile is None:
            continue # not a C++ tool

        name = subdir.path_from(bld.path)
        srcFiles = subdir.ant_glob('**/*.cpp', excl=['main.cpp'])
        srcObjects = ''
        if srcFiles:
            srcObjects = 'tools-%s-objects' % name
            bld.objects(target=srcObjects,
                        source=srcFiles,
                        use='NDN_CXX libndn-nac',
                        includes=name)
            testableObjects.append(srcObjects)

        bld.program(name=name,
                    target='../bin/%s' % name,
                    source=[mainFile],
                    use='NDN_CXX libndn-nac ' + srcObjects,
                    includes=name)

    bld.objects(target='tools-objects',
                source=[],
                export_includes='.',
                use=testableObjects)
