OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from compiler.ast import Const | 5 from compiler.ast import Const |
6 from compiler.ast import Dict | 6 from compiler.ast import Dict |
7 from compiler.ast import Discard | 7 from compiler.ast import Discard |
8 from compiler.ast import List | 8 from compiler.ast import List |
9 from compiler.ast import Module | 9 from compiler.ast import Module |
10 from compiler.ast import Node | 10 from compiler.ast import Node |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 parallel_state.pending += 1 | 596 parallel_state.pending += 1 |
597 data_in = {} | 597 data_in = {} |
598 data_in['target_build_files'] = data['target_build_files'] | 598 data_in['target_build_files'] = data['target_build_files'] |
599 aux_data_in = {} | 599 aux_data_in = {} |
600 global_flags = { | 600 global_flags = { |
601 'path_sections': globals()['path_sections'], | 601 'path_sections': globals()['path_sections'], |
602 'non_configuration_keys': globals()['non_configuration_keys'], | 602 'non_configuration_keys': globals()['non_configuration_keys'], |
603 'multiple_toolsets': globals()['multiple_toolsets']} | 603 'multiple_toolsets': globals()['multiple_toolsets']} |
604 | 604 |
605 if not parallel_state.pool: | 605 if not parallel_state.pool: |
606 parallel_state.pool = multiprocessing.Pool(8) | 606 parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count()) |
607 parallel_state.pool.apply_async( | 607 parallel_state.pool.apply_async( |
608 CallLoadTargetBuildFile, | 608 CallLoadTargetBuildFile, |
609 args = (global_flags, dependency, | 609 args = (global_flags, dependency, |
610 data_in, aux_data_in, | 610 data_in, aux_data_in, |
611 variables, includes, depth, check, generator_input_info), | 611 variables, includes, depth, check, generator_input_info), |
612 callback = parallel_state.LoadTargetBuildFileCallback) | 612 callback = parallel_state.LoadTargetBuildFileCallback) |
613 except KeyboardInterrupt, e: | 613 except KeyboardInterrupt, e: |
614 parallel_state.pool.terminate() | 614 parallel_state.pool.terminate() |
615 raise e | 615 raise e |
616 | 616 |
(...skipping 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2851 ValidateRunAsInTarget(target, target_dict, build_file) | 2851 ValidateRunAsInTarget(target, target_dict, build_file) |
2852 ValidateActionsInTarget(target, target_dict, build_file) | 2852 ValidateActionsInTarget(target, target_dict, build_file) |
2853 | 2853 |
2854 # Generators might not expect ints. Turn them into strs. | 2854 # Generators might not expect ints. Turn them into strs. |
2855 TurnIntIntoStrInDict(data) | 2855 TurnIntIntoStrInDict(data) |
2856 | 2856 |
2857 # TODO(mark): Return |data| for now because the generator needs a list of | 2857 # TODO(mark): Return |data| for now because the generator needs a list of |
2858 # build files that came in. In the future, maybe it should just accept | 2858 # build files that came in. In the future, maybe it should just accept |
2859 # a list, and not the whole data dict. | 2859 # a list, and not the whole data dict. |
2860 return [flat_list, targets, data] | 2860 return [flat_list, targets, data] |
OLD | NEW |