OLD | NEW |
---|---|
1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. 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 import("//build/split_static_library.gni") # When someone uses that target_type | 5 import("//build/split_static_library.gni") # When someone uses that target_type |
6 | 6 |
7 declare_args() { | 7 declare_args() { |
8 # If true, use a jumbo build (files compiled together) to speed up | 8 # If true, use a jumbo build (files compiled together) to speed up |
9 # compilation. | 9 # compilation. |
10 use_jumbo_build = false | 10 use_jumbo_build = !is_official_build && !(is_android && !is_clang) |
Dirk Pranke
2017/07/07 20:12:10
I'm guessing this change isn't intentional (or at
Daniel Bratell
2017/07/10 09:18:29
I'm adding and removing this in every CL to verify
| |
11 | 11 |
12 # A target to exclude from jumbo builds, for optimal round trip time | 12 # A target to exclude from jumbo builds, for optimal round trip time |
13 # when frequently changing a single cpp file. | 13 # when frequently changing a single cpp file. |
14 jumbo_build_excluded = "" | 14 jumbo_build_excluded = "" |
15 | 15 |
16 # How many files to group at most. Smaller numbers give more | 16 # How many files to group at most. Smaller numbers give more |
17 # parallellism, higher numbers give less total CPU usage. Higher | 17 # parallellism, higher numbers give less total CPU usage. Higher |
18 # numbers also give longer single-file recompilation times. | 18 # numbers also give longer single-file recompilation times. |
19 # | 19 # |
20 # Recommendations: | 20 # Recommendations: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 } | 59 } |
60 | 60 |
61 excluded_sources = [] | 61 excluded_sources = [] |
62 if (defined(invoker.jumbo_excluded_sources)) { | 62 if (defined(invoker.jumbo_excluded_sources)) { |
63 excluded_sources += invoker.jumbo_excluded_sources | 63 excluded_sources += invoker.jumbo_excluded_sources |
64 } | 64 } |
65 | 65 |
66 invoker_sources = invoker.sources | 66 invoker_sources = invoker.sources |
67 gen_target_dir = get_path_info(invoker_sources[0], "gen_dir") | 67 gen_target_dir = get_path_info(invoker_sources[0], "gen_dir") |
68 assert(excluded_sources != [] || true) # Prevent "unused variable". | 68 assert(excluded_sources != [] || true) # Prevent "unused variable". |
69 | |
70 # Find the gen_target_dir directory with shortest path. | |
Dirk Pranke
2017/07/07 20:12:10
This is a bit obscure. Can you add more to the com
Daniel Bratell
2017/07/10 09:18:30
I've expanded the comment.
The part I missed in g
| |
71 foreach(source_file, invoker.sources) { | |
72 possibly_better_gen_target_dir = get_path_info(gen_target_dir, "dir") | |
73 possibly_better_gen_target_dir_2 = | |
74 get_path_info(possibly_better_gen_target_dir, "dir") | |
75 alt_gen_target_dir = get_path_info(source_file, "gen_dir") | |
76 if (alt_gen_target_dir == possibly_better_gen_target_dir || | |
77 alt_gen_target_dir == possibly_better_gen_target_dir_2) { | |
78 gen_target_dir = alt_gen_target_dir | |
79 } | |
80 } | |
81 | |
69 assert(gen_target_dir != "") # Prevent "unused variable". | 82 assert(gen_target_dir != "") # Prevent "unused variable". |
70 | 83 |
71 if (use_jumbo_build_for_target) { | 84 if (use_jumbo_build_for_target) { |
72 jumbo_files = [] | 85 jumbo_files = [] |
73 | 86 |
74 # Split the sources list into chunks that are not excessively large | 87 # Split the sources list into chunks that are not excessively large |
75 files_per_chunk = jumbo_file_merge_limit | 88 files_per_chunk = jumbo_file_merge_limit |
76 current_file_index = 0 | 89 current_file_index = 0 |
77 next_chunk_start = 0 | 90 next_chunk_start = 0 |
78 next_chunk_number = 1 | 91 next_chunk_number = 1 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 forward_variables_from(invoker, "*", variables_to_not_forward) | 165 forward_variables_from(invoker, "*", variables_to_not_forward) |
153 } | 166 } |
154 } | 167 } |
155 | 168 |
156 set_defaults("jumbo_target") { | 169 set_defaults("jumbo_target") { |
157 # This sets the default list of configs when the content_source_set target | 170 # This sets the default list of configs when the content_source_set target |
158 # is defined. The default_compiler_configs comes from BUILDCONFIG.gn and | 171 # is defined. The default_compiler_configs comes from BUILDCONFIG.gn and |
159 # is the list normally applied to static libraries and source sets. | 172 # is the list normally applied to static libraries and source sets. |
160 configs = default_compiler_configs | 173 configs = default_compiler_configs |
161 } | 174 } |
OLD | NEW |