Index: build/config/jumbo.gni |
diff --git a/build/config/jumbo.gni b/build/config/jumbo.gni |
index baf19f1b6bf91c39a5a3c25aded68027de6485cc..a04d7bf5aab32453ecd20de4c8e0a687fddeef8d 100644 |
--- a/build/config/jumbo.gni |
+++ b/build/config/jumbo.gni |
@@ -7,7 +7,7 @@ import("//build/split_static_library.gni") # When someone uses that target_type |
declare_args() { |
# If true, use a jumbo build (files compiled together) to speed up |
# compilation. |
- use_jumbo_build = false |
+ use_jumbo_build = !is_official_build && !(is_android && !is_clang) |
Daniel Bratell
2017/07/04 11:37:44
Just to make cq test it. Must not be committed.
|
# A target to exclude from jumbo builds, for optimal round trip time |
# when frequently changing a single cpp file. |
@@ -86,6 +86,23 @@ template("jumbo_target") { |
current_file_index += 1 |
} |
+ has_objective_c_file = false |
+ has_c_file = false |
+ foreach(source_file, invoker.sources) { |
+ source_ext = get_path_info(source_file, "extension") |
+ if (source_ext == "c") { |
+ has_c_file = true |
+ } else if (source_ext == "mm") { |
+ has_objective_c_file = true |
+ } |
+ } |
+ if (has_c_file) { |
+ jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_c.c" ] |
+ } |
+ if (has_objective_c_file) { |
+ jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_mm.mm" ] |
+ } |
Dirk Pranke
2017/07/04 17:15:15
Clever. I hadn't thought of an obvious way to do t
|
+ |
merge_action_name = target_name + "__jumbo_merge" |
# Create an action that calls a script that merges all the source files. |
@@ -125,11 +142,9 @@ template("jumbo_target") { |
sources = jumbo_files + excluded_sources |
# Need to keep the headers in sources so that dependency checks |
- # work, and we need to keep Objective-C code since they |
- # cannot be merged into a cc file (FIXME). |
+ # work. |
foreach(source_file, invoker.sources) { |
- source_ext = get_path_info(source_file, "extension") |
- if (source_ext == "h" || source_ext == "mm") { |
+ if (get_path_info(source_file, "extension") == "h") { |
sources += [ source_file ] |
} |
} |