Automatically add the visualizer module to programs running with waf --run --vis
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed, 06 Jun 2012 18:42:13 +0100
changeset 8848 9a34e12fab31
parent 8847 1b229b79d37d
child 8849 22baeb9aabc8
Automatically add the visualizer module to programs running with waf --run --vis
wscript
--- a/wscript	Wed Jun 06 18:41:58 2012 +0100
+++ b/wscript	Wed Jun 06 18:42:13 2012 +0100
@@ -823,6 +823,9 @@
         # nothing more; this greatly speeds up compilation when all you
         # want to do is run a test program.
         Options.options.targets += ',' + os.path.basename(program_name)
+        if getattr(Options.options, "visualize", False):
+            program_obj = wutils.find_program(program_name, bld.env)
+            program_obj.use.append('ns3-visualizer')
         for gen in bld.all_task_gen:
             if type(gen).__name__ in ['ns3header_taskgen', 'ns3moduleheader_taskgen']:
                 gen.post()