wscript
changeset 3001 f7aa2796627f
parent 2990 69ddc1c42130
child 3002 3f851016493d
--- a/wscript	Mon Apr 21 17:31:01 2008 +0100
+++ b/wscript	Sat Apr 26 21:54:36 2008 +0100
@@ -6,9 +6,11 @@
 import optparse
 import os.path
 
+import pproc as subprocess
+
 import Params
 import Object
-import pproc as subprocess
+import ccroot
 
 Params.g_autoconfig = 1
 
@@ -218,6 +220,7 @@
 
 def create_ns3_program(bld, name, dependencies=('simulator',)):
     program = bld.create_obj('cpp', 'program')
+    program.is_ns3_program = True
     program.name = name
     program.target = program.name
     program.uselib_local = 'ns3'
@@ -351,7 +354,7 @@
                        # --enable-modules=xxx
         pass
     else:
-        prog = program_obj.path.find_build(program_obj.get_target_name()).abspath(env)
+        prog = program_obj.path.find_build(ccroot.get_target_name(program_obj)).abspath(env)
         out = open('doc/introspected-doxygen.h', 'w')
         if subprocess.Popen([prog], stdout=out, env=proc_env).wait():
             raise SystemExit(1)
@@ -359,12 +362,11 @@
 
     run_program('run-tests', get_command_template())
 
-
 def _find_program(program_name, env):
     launch_dir = os.path.abspath(Params.g_cwd_launch)
     found_programs = []
     for obj in Object.g_allobjs:
-        if obj.m_type != 'program' or not obj.target:
+        if not getattr(obj, 'is_ns3_program', False):
             continue
 
         ## filter out programs not in the subtree starting at the launch dir
@@ -430,7 +432,7 @@
             Params.fatal(str(ex))
 
         try:
-            program_node = program_obj.path.find_build(program_obj.get_target_name())
+            program_node = program_obj.path.find_build(ccroot.get_target_name(program_obj))
         except AttributeError:
             Params.fatal("%s does not appear to be a program" % (program_name,))
 
@@ -444,7 +446,7 @@
         except ValueError, ex:
             Params.fatal(str(ex))
         try:
-            program_node = program_obj.path.find_build(program_obj.get_target_name())
+            program_node = program_obj.path.find_build(ccroot.get_target_name(program_obj))
         except AttributeError:
             Params.fatal("%s does not appear to be a program" % (program_name,))