When --run'ing a program, tell WAF to only build that program, nothing more.
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Mon, 24 Nov 2008 15:28:42 +0000
changeset 3918 3604c4e42fd1
parent 3917 fe95a4f9d423
child 3919 fd796ed5b166
When --run'ing a program, tell WAF to only build that program, nothing more. This greatly speeds up compilation when all you want to do is run a test program, as it skips the time consuming linking to be done for all example programs.
wscript
--- a/wscript	Mon Nov 24 12:39:50 2008 +0000
+++ b/wscript	Mon Nov 24 15:28:42 2008 +0000
@@ -354,6 +354,13 @@
 
 
 def build(bld):
+    
+    # When --run'ing a program, tell WAF to only build that program,
+    # nothing more; this greatly speeds up compilation when all you
+    # want to do is run a test program.
+    if Params.g_options.run and not Params.g_options.compile_targets:
+        Params.g_options.compile_targets = Params.g_options.run
+
     if Params.g_options.no_task_lines:
         import Runner
         def null_printout(s):