mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-20 16:35:38 +08:00
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:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user