Revision
3358
Author
eloy.de.enige@gmail.com
Date
2010-01-27 14:07:21 -0800 (Wed, 27 Jan 2010)

Log Message

Allow the :objects rake task to build in parallel.

Modified Paths

Diff

Modified: MacRuby/trunk/rakelib/builder/builder.rb (3357 => 3358)


--- MacRuby/trunk/rakelib/builder/builder.rb	2010-01-27 01:13:51 UTC (rev 3357)
+++ MacRuby/trunk/rakelib/builder/builder.rb	2010-01-27 22:07:21 UTC (rev 3358)
@@ -54,6 +54,7 @@
 
   def build(objs=nil)
     objs ||= @objs
+    commands = []
     objs.each do |obj| 
       if should_build?(obj) 
         s = obj_source(obj)
@@ -67,9 +68,10 @@
         if f = @objs_cflags[obj]
           flags += " #{f}"
         end
-        sh("#{cc} #{flags} -c #{s} -o #{obj}.o")
+        commands << "#{cc} #{flags} -c #{s} -o #{obj}.o"
       end
     end
+    self.class.parallel_execute(commands)
   end
  
   def link_executable(name, objs=nil, ldflags=nil)