utils/wscript
author Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
Fri, 15 Jun 2007 15:19:38 +0100
changeset 770 6441e0706902
parent 600 fd944dbf33c6
child 771 86b8d2312ec8
permissions -rw-r--r--
WAF: make all ns3 modules register themselves in the environment; link the run-tests program with all ns3 modules, not with a hardcoded list.

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


def build(bld):
    env = bld.env_of_name('default')

    def create_ns_prog(name, source):
        obj = bld.create_obj('cpp', 'program')
        obj.target = name
        obj.source = source
        return obj

    unit_tests = create_ns_prog('run-tests', 'run-tests.cc')
    unit_tests.install_var  = 0 # do not install
    unit_tests.unit_test    = 1 # runs on 'waf check'
    ## link unit test program with all ns3 modules
    unit_tests.uselib_local = env['NS3_MODULES']
    print env['NS3_MODULES']
    
    obj = create_ns_prog('bench-simulator', 'bench-simulator.cc')
    obj.uselib_local = "ns3-core ns3-common ns3-simulator"

    obj = create_ns_prog('replay-simulation', 'replay-simulation.cc')
    obj.uselib_local = "ns3-core ns3-common ns3-simulator"