improve build system in order to compile spec files in parallel as much as possible

So far, RubyMotion has two phase in compile when run spec (1. compile app files, 2. compile spec files).
it make idle cpu cores when finished to compile app files (before starting to compile spec files).
This commit is contained in:
Watson
2013-12-27 14:05:49 +09:00
parent 7ee521bf2e
commit 4367f3bf3c

View File

@@ -165,22 +165,18 @@ module Motion; module Project;
parallel = ParallelBuilder.new(objs_build_dir, build_file)
parallel.files = config.ordered_build_files
parallel.files += config.spec_files if config.spec_mode
parallel.run
objs = parallel.objects
FileUtils.touch(objs_build_dir) if any_obj_file_built
app_objs = objs
objs = app_objs = parallel.objects
spec_objs = []
if config.spec_mode
# Build spec files too, but sequentially.
parallel = ParallelBuilder.new(objs_build_dir, build_file)
parallel.files = config.spec_files
parallel.run
spec_objs = parallel.objects
objs += spec_objs
app_objs = objs[0...config.ordered_build_files.size]
spec_objs = objs[-(config.spec_files.size)..-1]
end
FileUtils.touch(objs_build_dir) if any_obj_file_built
# Generate init file.
init_txt = <<EOS
extern "C" {