utils/wscript
author Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
Mon, 07 May 2007 12:01:51 +0100
changeset 537 e8a4183dfe00
child 600 fd944dbf33c6
permissions -rw-r--r--
Add support for building with WAF

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

def build(bld):

    def create_ns_prog(name, source):
        obj = bld.create_obj('cpp', 'program')
        obj.target = name
        obj.deps = "ns3-core ns3-common ns3-simulator"
        obj.uselib_local = "ns3-core ns3-common ns3-simulator"
        obj.source = source
        for module in ['core', 'common', 'simulator']:
            obj.env.append_value('RPATH', r'-Wl,--rpath=\$ORIGIN/../src/%s' % (module,))
        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
    
    #if sys.platform != 'win32':
    obj = create_ns_prog('bench-simulator', 'bench-simulator.cc')
    obj = create_ns_prog('replay-simulation', 'replay-simulation.cc')
    ## bench-packets requires missing header files
    #obj = create_ns_prog('bench-packets', 'bench-packets.cc')