| OLD | NEW |
| 1 import("//build/split_static_library.gni") # When someone uses that target_type | 1 import("//build/split_static_library.gni") # When someone uses that target_type |
| 2 | 2 |
| 3 declare_args() { | 3 declare_args() { |
| 4 # If true, use a jumbo build (files compiled together) to speed up | 4 # If true, use a jumbo build (files compiled together) to speed up |
| 5 # compilation. | 5 # compilation. |
| 6 use_blink_jumbo_build = true | 6 use_blink_jumbo_build = true |
| 7 | 7 |
| 8 # A target to exclude from jumbo builds, for optimal round trip time | 8 # A target to exclude from jumbo builds, for optimal round trip time |
| 9 # when frequently changing a single cpp file. | 9 # when frequently changing a single cpp file. |
| 10 jumbo_build_excluded = "" | 10 jumbo_build_excluded = "" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 target(target_type, target_name) { | 70 target(target_type, target_name) { |
| 71 deps = [] | 71 deps = [] |
| 72 if (defined(invoker.deps)) { | 72 if (defined(invoker.deps)) { |
| 73 deps += invoker.deps | 73 deps += invoker.deps |
| 74 } | 74 } |
| 75 | 75 |
| 76 # Take everything else not handled above from the invoker. | 76 # Take everything else not handled above from the invoker. |
| 77 variables_to_not_forward = [ "deps" ] | 77 variables_to_not_forward = [ "deps" ] |
| 78 if (use_jumbo_build) { | 78 if (use_jumbo_build) { |
| 79 deps += [ ":" + target_name + "_jumbo" ] | 79 deps += [ ":" + target_name + "_jumbo" ] |
| 80 |
| 81 if (is_android && !is_clang) { |
| 82 cflags = [] |
| 83 if (defined(invoker.cflags)) { |
| 84 cflags += invoker.cflags |
| 85 } |
| 86 cflags += [ "-Wno-subobject-linkage" ] |
| 87 variables_to_not_forward += [ "cflags" ] |
| 88 } |
| 89 |
| 80 variables_to_not_forward += [ "sources" ] | 90 variables_to_not_forward += [ "sources" ] |
| 81 assert(jumbo_files != []) | 91 assert(jumbo_files != []) |
| 82 sources = jumbo_files + excluded_sources | 92 sources = jumbo_files + excluded_sources |
| 83 | 93 |
| 84 # And the headers so that dependency checks work. | 94 # And the headers so that dependency checks work. |
| 85 foreach(source_file, invoker.sources) { | 95 foreach(source_file, invoker.sources) { |
| 86 if (get_path_info(source_file, "extension") == "h") { | 96 if (get_path_info(source_file, "extension") == "h") { |
| 87 sources += [ source_file ] | 97 sources += [ source_file ] |
| 88 } | 98 } |
| 89 } | 99 } |
| 100 |
| 101 # Can't mix in Objective-C code in a cc file (FIXME). |
| 102 foreach(source_file, invoker.sources) { |
| 103 if (get_path_info(source_file, "extension") == "mm") { |
| 104 sources += [ source_file ] |
| 105 } |
| 106 } |
| 90 } | 107 } |
| 91 forward_variables_from(invoker, "*", variables_to_not_forward) | 108 forward_variables_from(invoker, "*", variables_to_not_forward) |
| 92 } | 109 } |
| 93 } | 110 } |
| 94 | 111 |
| 95 set_defaults("jumbo_target") { | 112 set_defaults("jumbo_target") { |
| 96 # This sets the default list of configs when the content_source_set target | 113 # This sets the default list of configs when the content_source_set target |
| 97 # is defined. The default_compiler_configs comes from BUILDCONFIG.gn and | 114 # is defined. The default_compiler_configs comes from BUILDCONFIG.gn and |
| 98 # is the list normally applied to static libraries and source sets. | 115 # is the list normally applied to static libraries and source sets. |
| 99 configs = default_compiler_configs | 116 configs = default_compiler_configs |
| 100 } | 117 } |
| OLD | NEW |