We already support jumbo_source_set, jumbo_component and
jumbo_static_library so this is just another common template with a
non-default configuration.

This is needed in some form for jumbo in blink unittests.

Bug: 761475
Change-Id: I443fedb4a41c43cf21102e2a2f8ced937961665c
Reviewed-on: https://chromium-review.googlesource.com/671369
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Original-Commit-Position: refs/heads/master@{#503193}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 21f6df2a9bbb8c7bc60186c2ae1792b8361e1c5d
This commit is contained in:
Daniel Bratell 2017-09-20 17:53:01 +00:00 коммит произвёл Commit Bot
Родитель 172bc1abd4
Коммит 5c56eee170
1 изменённых файлов: 31 добавлений и 8 удалений

Просмотреть файл

@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/split_static_library.gni") # When someone uses that target_type import("//build/split_static_library.gni") # When someone uses that target_type
import("//testing/test.gni") # When someone uses the test target_type
declare_args() { declare_args() {
# If true, use a jumbo build (files compiled together) to speed up # If true, use a jumbo build (files compiled together) to speed up
@ -198,8 +199,8 @@ template("jumbo_source_set") {
} }
set_defaults("jumbo_source_set") { set_defaults("jumbo_source_set") {
# This sets the default list of configs when the content_source_set target # This sets the default list of configs when the source_set target
# is defined. The default_compiler_configs comes from BUILDCONFIG.gn and # is used. The default_compiler_configs comes from BUILDCONFIG.gn and
# is the list normally applied to static libraries and source sets. # is the list normally applied to static libraries and source sets.
configs = default_compiler_configs configs = default_compiler_configs
} }
@ -213,8 +214,8 @@ template("jumbo_static_library") {
} }
set_defaults("jumbo_static_library") { set_defaults("jumbo_static_library") {
# This sets the default list of configs when the content_source_set target # This sets the default list of configs when the static_library target
# is defined. The default_compiler_configs comes from BUILDCONFIG.gn and # is used. The default_compiler_configs comes from BUILDCONFIG.gn and
# is the list normally applied to static libraries and source sets. # is the list normally applied to static libraries and source sets.
configs = default_compiler_configs configs = default_compiler_configs
} }
@ -228,8 +229,9 @@ template("jumbo_split_static_library") {
} }
set_defaults("jumbo_split_static_library") { set_defaults("jumbo_split_static_library") {
# This sets the default list of configs when the content_source_set target # This sets the default list of configs when the
# is defined. The default_compiler_configs comes from BUILDCONFIG.gn and # split_static_library target is used.
# The default_compiler_configs comes from BUILDCONFIG.gn and
# is the list normally applied to static libraries and source sets. # is the list normally applied to static libraries and source sets.
configs = default_compiler_configs configs = default_compiler_configs
} }
@ -243,8 +245,8 @@ template("jumbo_component") {
} }
set_defaults("jumbo_component") { set_defaults("jumbo_component") {
# This sets the default list of configs when the content_source_set # This sets the default list of configs when the component
# target is defined. This code is a clone of set_defaults for the # target is used. This code is a clone of set_defaults for the
# ordinary "component" template. # ordinary "component" template.
if (is_component_build) { if (is_component_build) {
configs = default_shared_library_configs configs = default_shared_library_configs
@ -255,3 +257,24 @@ set_defaults("jumbo_component") {
configs = default_compiler_configs configs = default_compiler_configs
} }
} }
# See documentation above by "internal_jumbo_target".
template("jumbo_test") {
internal_jumbo_target(target_name) {
target_type = "test"
forward_variables_from(invoker, "*")
}
}
set_defaults("jumbo_test") {
# This sets the default list of configs when the test target is
# used. This code is a clone of set_defaults for the ordinary
# "test" template.
if (is_android) {
configs = default_shared_library_configs
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ "//build/config/android:hide_all_but_jni" ]
} else {
configs = default_executable_configs
}
}