• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# =============================================================================
6# WHAT IS THIS FILE?
7# =============================================================================
8#
9# This is the master GN build configuration. This file is loaded after the
10# build args (args.gn) for the build directory and after the toplevel ".gn"
11# file (which points to this file as the build configuration).
12#
13# This file will be executed and the resulting context will be used to execute
14# every other file in the build. So variables declared here (that don't start
15# with an underscore) will be implicitly global.
16
17# =============================================================================
18# PLATFORM SELECTION
19# =============================================================================
20#
21# There are two main things to set: "os" and "cpu". The "toolchain" is the name
22# of the GN thing that encodes combinations of these things.
23#
24# Users typically only set the variables "target_os" and "target_cpu" in "gn
25# args", the rest are set up by our build and internal to GN.
26#
27# There are three different types of each of these things: The "host"
28# represents the computer doing the compile and never changes. The "target"
29# represents the main thing we're trying to build. The "current" represents
30# which configuration is currently being defined, which can be either the
31# host, the target, or something completely different (like nacl). GN will
32# run the same build file multiple times for the different required
33# configuration in the same build.
34#
35# This gives the following variables:
36#  - host_os, host_cpu, host_toolchain
37#  - target_os, target_cpu, default_toolchain
38#  - current_os, current_cpu, current_toolchain.
39#
40# Note the default_toolchain isn't symmetrical (you would expect
41# target_toolchain). This is because the "default" toolchain is a GN built-in
42# concept, and "target" is something our build sets up that's symmetrical with
43# its GYP counterpart. Potentially the built-in default_toolchain variable
44# could be renamed in the future.
45#
46# When writing build files, to do something only for the host:
47#   if (current_toolchain == host_toolchain) { ...
48
49declare_args() {
50  product_name = ""
51  device_name = ""
52  preloader_output_dir = "//out/preloader"
53}
54
55product_build_config =
56    read_file("${preloader_output_dir}/${product_name}/build_config.json",
57              "json")
58
59global_parts_info =
60    read_file("${preloader_output_dir}/${product_name}/parts_config.json",
61              "json")
62
63product_company = product_build_config.product_company
64device_company = product_build_config.device_company
65target_os = product_build_config.target_os
66target_cpu = product_build_config.target_cpu
67product_toolchain = product_build_config.product_toolchain_label
68if (product_toolchain == "") {
69  product_toolchain = "//build/toolchain/ohos:ohos_clang_$target_cpu"
70}
71if (defined(product_build_config.enable_ramdisk)) {
72  enable_ramdisk = product_build_config.enable_ramdisk
73} else {
74  enable_ramdisk = false
75}
76
77if (defined(product_build_config.build_selinux)) {
78  build_selinux = product_build_config.build_selinux
79} else {
80  build_selinux = false
81}
82
83if (defined(product_build_config.support_jsapi)) {
84  support_jsapi = product_build_config.support_jsapi
85} else {
86  support_jsapi = true
87}
88
89if (target_os == "") {
90  target_os = "ohos"
91}
92
93if (target_cpu == "") {
94  if (target_os == "ohos") {
95    target_cpu = "arm"
96  } else {
97    target_cpu = host_cpu
98  }
99}
100
101if (current_cpu == "") {
102  current_cpu = target_cpu
103}
104if (current_os == "") {
105  current_os = target_os
106}
107
108declare_args() {
109  is_mini_system = false
110  is_small_system = false
111  is_standard_system = false
112}
113
114if (is_mini_system) {
115  os_level = "mini"
116}
117if (is_small_system) {
118  os_level = "small"
119}
120if (is_standard_system) {
121  os_level = "standard"
122}
123
124declare_args() {
125  is_large_system = !(is_standard_system || is_small_system || is_mini_system)
126}
127
128is_lite_system = is_mini_system || is_small_system
129
130# =============================================================================
131# BUILD FLAGS
132# =============================================================================
133#
134# This block lists input arguments to the build, along with their default
135# values.
136#
137# If a value is specified on the command line, it will overwrite the defaults
138# given in a declare_args block, otherwise the default will be used.
139#
140# YOU SHOULD ALMOST NEVER NEED TO ADD FLAGS TO THIS FILE. GN allows any file in
141# the build to declare build flags. If you need a flag for a single component,
142# you can just declare it in the corresponding BUILD.gn file.
143#
144# - If your feature is a single target, say //components/foo, you can put
145#   a declare_args() block in //components/foo/BUILD.gn and use it there.
146#   Nobody else in the build needs to see the flag.
147#
148# - Defines based on build variables should be implemented via the generated
149#   build flag header system. See //build/buildflag_header.gni. You can put
150#   the buildflag_header target in the same file as the build flag itself. You
151#   should almost never set "defines" directly.
152#
153# - If your flag toggles a target on and off or toggles between different
154#   versions of similar things, write a "group" target that forwards to the
155#   right target (or no target) depending on the value of the build flag. This
156#   group can be in the same BUILD.gn file as the build flag, and targets can
157#   depend unconditionally on the group rather than duplicating flag checks
158#   across many targets.
159#
160# - If a semi-random set of build files REALLY needs to know about a define and
161#   the above pattern for isolating the build logic in a forwarding group
162#   doesn't work, you can put the argument in a .gni file. This should be put
163#   in the lowest level of the build that knows about this feature (which should
164#   almost always be outside of the //build directory!).
165#
166# Other flag advice:
167#
168# - Use boolean values when possible. If you need a default value that expands
169#   to some complex thing in the default case (like the location of the
170#   compiler which would be computed by a script), use a default value of -1 or
171#   the empty string. Outside of the declare_args block, conditionally expand
172#   the default value as necessary.
173#
174# - Use a name like "use_foo" or "is_foo" (whatever is more appropriate for
175#   your feature) rather than just "foo".
176#
177# - Write good comments directly above the declaration with no blank line.
178#   These comments will appear as documentation in "gn args --list".
179#
180# - Don't call exec_script inside declare_args. This will execute the script
181#   even if the value is overridden, which is wasteful. See first bullet.
182
183declare_args() {
184  # Set to enable the official build level of optimization. This has nothing
185  # to do with branding, but enables an additional level of optimization above
186  # release (!is_debug). This might be better expressed as a tri-state
187  # (debug, release, official) but for historical reasons there are two
188  # separate flags.
189  is_official_build = false
190
191  # Whether we're a traditional desktop unix.
192  is_desktop_linux = current_os == "linux"
193
194  # Set to true when compiling with the Clang compiler.
195  is_clang = current_os != "linux" ||
196             (current_cpu != "s390x" && current_cpu != "s390" &&
197              current_cpu != "ppc64" && current_cpu != "ppc" &&
198              current_cpu != "mips" && current_cpu != "mips64")
199
200  # Allows the path to a custom target toolchain to be injected as a single
201  # argument, and set as the default toolchain.
202  custom_toolchain = ""
203
204  # This should not normally be set as a build argument.  It's here so that
205  # every toolchain can pass through the "global" value via toolchain_args().
206  host_toolchain = ""
207
208  # target platform
209  target_platform = "phone"
210
211  # Whether it is test.
212  is_test = false
213
214  # Whether it is double framework.
215  is_double_framework = false
216}
217
218declare_args() {
219  use_musl = true
220}
221
222asdk_libs_dir = "//prebuilts/asdk_libs"
223
224# Whether it is a phone product.
225is_phone_product = "${target_platform}" == "phone"
226
227# Whether it is a ivi product.
228is_ivi_product = "${target_platform}" == "ivi"
229
230is_wearable_product = "${target_platform}" == "wearable"
231
232is_intellitv_product = "${target_platform}" == "intellitv"
233
234is_emulator = false
235
236if (target_os == "ohos" && target_cpu == "x86_64") {
237  is_emulator = true
238}
239
240# different host platform tools directory.
241if (host_os == "linux") {
242  host_platform_dir = "linux-x86_64"
243} else if (host_os == "mac") {
244  host_platform_dir = "darwin-x86_64"
245} else {
246  assert(false, "Unsupported host_os: $host_os")
247}
248
249declare_args() {
250  # Debug build. Enabling official builds automatically sets is_debug to false.
251  is_debug = false
252}
253
254declare_args() {
255  build_xts = false
256}
257
258declare_args() {
259  # Component build. Setting to true compiles targets declared as "components"
260  # as shared libraries loaded dynamically. This speeds up development time.
261  # When false, components will be linked statically.
262  #
263  # For more information see
264  # https://chromium.googlesource.com/chromium/src/+/master/docs/component_build.md
265  is_component_build = true
266}
267
268assert(!(is_debug && is_official_build), "Can't do official debug builds")
269
270# ==============================================================================
271# TOOLCHAIN SETUP
272# ==============================================================================
273#
274# Here we set the default toolchain, as well as the variable host_toolchain
275# which will identify the toolchain corresponding to the local system when
276# doing cross-compiles. When not cross-compiling, this will be the same as the
277# default toolchain.
278#
279# We do this before anything else to make sure we complain about any
280# unsupported os/cpu combinations as early as possible.
281
282if (host_toolchain == "") {
283  # This should only happen in the top-level context.
284  # In a specific toolchain context, the toolchain_args()
285  # block should have propagated a value down.
286
287  if (host_os == "linux") {
288    if (target_os != "linux") {
289      host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
290    } else if (is_clang) {
291      host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
292    } else {
293      host_toolchain = "//build/toolchain/linux:$host_cpu"
294    }
295  } else if (host_os == "mac") {
296    host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
297  } else if (host_os == "win") {
298    if (target_cpu == "x86" || target_cpu == "x64") {
299      if (is_clang) {
300        host_toolchain = "//build/toolchain/win:win_clang_$target_cpu"
301      } else {
302        host_toolchain = "//build/toolchain/win:$target_cpu"
303      }
304    } else if (is_clang) {
305      host_toolchain = "//build/toolchain/win:win_clang_$host_cpu"
306    } else {
307      host_toolchain = "//build/toolchain/win:$host_cpu"
308    }
309  } else {
310    assert(false, "Unsupported host_os: $host_os")
311  }
312}
313
314if (is_standard_system) {
315  _default_toolchain = ""
316
317  if (target_os == "ohos") {
318    assert(host_os == "linux" || host_os == "mac",
319           "ohos builds are only supported on Linux and Mac hosts.")
320    _default_toolchain = product_toolchain
321  } else if (target_os == "linux") {
322    if (is_clang) {
323      _default_toolchain = "//build/toolchain/linux:clang_$target_cpu"
324    } else {
325      _default_toolchain = "//build/toolchain/linux:$target_cpu"
326    }
327  } else {
328    assert(false, "Unsupported target_os: $target_os")
329  }
330
331  # If a custom toolchain has been set in the args, set it as default. Otherwise,
332  # set the default toolchain for the platform (if any).
333  if (custom_toolchain != "") {
334    set_default_toolchain(custom_toolchain)
335  } else if (_default_toolchain != "") {
336    set_default_toolchain(_default_toolchain)
337  }
338}
339
340# =============================================================================
341# OS DEFINITIONS
342# =============================================================================
343#
344# We set these various is_FOO booleans for convenience in writing OS-based
345# conditions.
346#
347# - is_ohos, is_chromeos, and is_win should be obvious.
348# - is_mac is set only for desktop Mac.
349# - is_posix is true for mac and any Unix-like system (basically everything
350#   except Windows).
351# - is_linux is true for desktop Linux and ChromeOS.
352#
353# Do not add more is_* variants here for random lesser-used Unix systems like
354# aix or one of the BSDs. If you need to check these, just check the
355# current_os value directly.
356
357if (current_os == "win" || current_os == "winuwp") {
358  is_aix = false
359  is_ohos = false
360  is_chromeos = false
361  is_linux = false
362  is_mac = false
363  is_nacl = false
364  is_posix = false
365  is_win = true
366  is_mingw = false
367} else if (current_os == "mac") {
368  is_aix = false
369  is_ohos = false
370  is_chromeos = false
371  is_linux = false
372  is_mac = true
373  is_nacl = false
374  is_posix = true
375  is_win = false
376  is_mingw = false
377} else if (current_os == "ohos") {
378  is_aix = false
379  is_ohos = true
380  is_chromeos = false
381  is_linux = false
382  is_mac = false
383  is_nacl = false
384  is_posix = true
385  is_win = false
386  is_mingw = false
387} else if (current_os == "linux") {
388  is_aix = false
389  is_ohos = false
390  is_chromeos = false
391  is_linux = true
392  is_mac = false
393  is_nacl = false
394  is_posix = true
395  is_win = false
396  is_mingw = false
397} else if (current_os == "mingw") {
398  is_aix = false
399  is_ohos = false
400  is_chromeos = false
401  is_linux = false
402  is_mac = false
403  is_nacl = false
404  is_posix = true
405  is_win = false
406  is_mingw = true
407}
408
409# =============================================================================
410# SOURCES FILTERS
411# =============================================================================
412#
413# These patterns filter out platform-specific files when assigning to the
414# sources variable. The magic variable |sources_assignment_filter| is applied
415# to each assignment or appending to the sources variable and matches are
416# automatically removed.
417#
418# Note that the patterns are NOT regular expressions. Only "*" and "\b" (path
419# boundary = end of string or slash) are supported, and the entire string
420# must match the pattern (so you need "*.cc" to match all .cc files, for
421# example).
422
423# DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
424# below.
425sources_assignment_filter = []
426
427if (!is_win && !is_mingw) {
428  sources_assignment_filter += [
429    "*_win.cc",
430    "*_win.h",
431    "*_win_unittest.cc",
432    "*\bwin/*",
433    "*.def",
434  ]
435}
436if (!is_mac) {
437  sources_assignment_filter += [
438    "*_mac.h",
439    "*_mac.cc",
440    "*_mac.mm",
441    "*_mac_unittest.h",
442    "*_mac_unittest.cc",
443    "*_mac_unittest.mm",
444    "*\bmac/*",
445    "*_cocoa.h",
446    "*_cocoa.cc",
447    "*_cocoa.mm",
448    "*_cocoa_unittest.h",
449    "*_cocoa_unittest.cc",
450    "*_cocoa_unittest.mm",
451    "*\bcocoa/*",
452  ]
453}
454if (!is_linux && !is_ohos) {
455  sources_assignment_filter += [
456    "*_linux.h",
457    "*_linux.cc",
458    "*_linux_unittest.h",
459    "*_linux_unittest.cc",
460    "*\blinux/*",
461  ]
462}
463if (!is_ohos) {
464  sources_assignment_filter += []
465}
466
467set_sources_assignment_filter(sources_assignment_filter)
468if (is_standard_system) {
469  # =============================================================================
470  # TARGET DEFAULTS
471  # =============================================================================
472  #
473  # Set up the default configuration for every build target of the given type.
474  # The values configured here will be automatically set on the scope of the
475  # corresponding target. Target definitions can add or remove to the settings
476  # here as needed.
477  #
478  # WHAT GOES HERE?
479  #
480  # Other than the main compiler and linker configs, the only reason for a config
481  # to be in this list is if some targets need to explicitly override that config
482  # by removing it. This is how targets opt-out of flags. If you don't have that
483  # requirement and just need to add a config everywhere, reference it as a
484  # sub-config of an existing one, most commonly the main "compiler" one.
485
486  # Holds all configs used for running the compiler.
487  default_compiler_configs = [
488    "//build/config:feature_flags",
489    "//build/config/compiler:afdo",
490    "//build/config/compiler:afdo_optimize_size",
491    "//build/config/compiler:compiler",
492    "//build/config/compiler:compiler_arm_fpu",
493    "//build/config/compiler:compiler_arm_thumb",
494    "//build/config/compiler:chromium_code",
495    "//build/config/compiler:default_include_dirs",
496    "//build/config/compiler:default_optimization",
497    "//build/config/compiler:default_stack_frames",
498    "//build/config/compiler:default_symbols",
499    "//build/config/compiler:export_dynamic",
500    "//build/config/compiler:no_exceptions",
501    "//build/config/compiler:no_rtti",
502    "//build/config/compiler:runtime_library",
503    "//build/config/compiler:thin_archive",
504    "//build/config/compiler:no_common",
505    "//build/config/coverage:default_coverage",
506    "//build/config/sanitizers:default_sanitizer_flags",
507  ]
508
509  if (is_ohos) {
510    default_compiler_configs += [
511      "//build/config/ohos:default_orderfile_instrumentation",
512      "//build/config/gcc:symbol_visibility_inline_hidden",
513    ]
514  }
515
516  if (is_clang) {
517    default_compiler_configs += [
518      "//build/config/clang:find_bad_constructs",
519      "//build/config/clang:extra_warnings",
520    ]
521  }
522
523  # Debug/release-related defines.
524  if (is_debug) {
525    default_compiler_configs += [ "//build/config:debug" ]
526  } else {
527    default_compiler_configs += [ "//build/config:release" ]
528  }
529
530  # Static libraries and source sets use only the compiler ones.
531  default_static_library_configs = default_compiler_configs
532  default_source_set_configs = default_compiler_configs
533
534  # Executable defaults.
535  default_executable_configs = default_compiler_configs + [
536                                 "//build/config:default_libs",
537                                 "//build/config:executable_config",
538                               ]
539
540  # Shared library and loadable module defaults (also for components in component
541  # mode).
542  default_shared_library_configs = default_compiler_configs + [
543                                     "//build/config:default_libs",
544                                     "//build/config:shared_library_config",
545                                   ]
546}
547
548# Lite OS use different buildconfig.gn
549if (is_lite_system) {
550  import("//build/lite/ohos_var.gni")
551  import("${device_path}/config.gni")
552  target_arch_cflags = board_cflags
553  if (board_arch != "") {
554    target_arch_cflags += [ "-march=$board_arch" ]
555  }
556  if (board_cpu != "") {
557    target_arch_cflags += [ "-mcpu=$board_cpu" ]
558  }
559
560  arch = "arm"
561  if (ohos_kernel_type == "liteos_a") {
562    target_triple = "$arch-liteos-ohos"
563  } else if (ohos_kernel_type == "linux") {
564    target_triple = "$arch-linux-ohos"
565  }
566
567  if (defined(board_configed_sysroot) && board_configed_sysroot != "") {
568    ohos_current_sysroot = board_configed_sysroot
569  }
570
571  # Only gcc available for liteos_m.
572  if (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "linux") {
573    use_board_toolchain = true
574  }
575
576  toolchain_cmd_suffix = ""
577  if (host_os == "win") {
578    toolchain_cmd_suffix = ".exe"
579  }
580
581  # enable ccache if ccache installed.
582  if (ohos_build_enable_ccache) {
583    compile_prefix = "ccache "
584  } else {
585    compile_prefix = ""
586  }
587
588  # Load board adapter dir from board config.
589  if (board_adapter_dir != "") {
590    ohos_board_adapter_dir = board_adapter_dir
591    ohos_vendor_adapter_dir = board_adapter_dir
592  }
593
594  default_compiler_configs = []
595
596  # Set current toolchain with to board configuration.
597  if (board_toolchain != "" && use_board_toolchain) {
598    ohos_build_compiler = board_toolchain_type
599    if (board_toolchain_path != "") {
600      compile_prefix += "${board_toolchain_path}/${board_toolchain_prefix}"
601    } else {
602      compile_prefix += "${board_toolchain_prefix}"
603    }
604    set_default_toolchain("//build/lite/toolchain:${board_toolchain}")
605    if (board_toolchain_type == "gcc") {
606      ohos_current_cc_command = "${compile_prefix}gcc$toolchain_cmd_suffix"
607      ohos_current_cxx_command = "${compile_prefix}g++$toolchain_cmd_suffix"
608      ohos_current_ar_command = "${compile_prefix}ar$toolchain_cmd_suffix"
609      ohos_current_ld_command = ohos_current_cc_command
610      ohos_current_strip_command =
611          "${compile_prefix}strip$toolchain_cmd_suffix --strip-unneeded"
612      default_compiler_configs += [ "//build/lite/config:gcc_opt" ]
613    } else if (board_toolchain_type == "clang") {
614      ohos_current_cc_command = "${compile_prefix}clang$toolchain_cmd_suffix"
615      ohos_current_cxx_command = "${compile_prefix}clang++$toolchain_cmd_suffix"
616      compile_prefix += "llvm-"
617      ohos_current_ar_command = "${compile_prefix}ar$toolchain_cmd_suffix"
618      ohos_current_ld_command = ohos_current_cc_command
619      ohos_current_strip_command =
620          "${compile_prefix}strip$toolchain_cmd_suffix --strip-unneeded"
621      default_compiler_configs += [ "//build/lite/config:clang_opt" ]
622    }
623
624    # Overwrite ld cmd by customed cmd.
625    if (defined(board_customed_ld_cmd) && board_customed_ld_cmd != "") {
626      ohos_current_ld_command = board_customed_ld_cmd
627    }
628  } else {
629    # OHOS default toolchain
630    ohos_build_compiler = "clang"
631    ohos_clang_toolchain_dir = rebase_path("${ohos_build_compiler_dir}/bin")
632    compile_prefix += "$ohos_clang_toolchain_dir/"
633    ohos_current_cc_command = "${compile_prefix}clang$toolchain_cmd_suffix"
634    ohos_current_cxx_command = "${compile_prefix}clang++$toolchain_cmd_suffix"
635    compile_prefix += "llvm-"
636    ohos_current_ar_command = "${compile_prefix}ar$toolchain_cmd_suffix"
637    ohos_current_ld_command = ohos_current_cxx_command
638    ohos_current_strip_command =
639        "${compile_prefix}strip$toolchain_cmd_suffix --strip-unneeded"
640    set_default_toolchain("//build/lite/toolchain:linux_x86_64_ohos_clang")
641    default_compiler_configs += [
642      "//build/lite/config:ohos_clang",
643      "//build/lite/config:clang_opt",
644    ]
645  }
646
647  default_compiler_configs += [
648    "//build/lite/config:board_config",
649    "//build/lite/config:cpu_arch",
650    "//build/lite/config:common",
651    "//build/lite/config:default_link_path",
652  ]
653
654  if (ohos_build_type == "debug") {
655    default_compiler_configs += [ "//build/lite/config:debug" ]
656  } else if (ohos_build_type == "release") {
657    default_compiler_configs += [ "//build/lite/config:release" ]
658  }
659
660  if (ohos_kernel_type == "liteos_a") {
661    default_compiler_configs +=
662        [ "//build/lite/config/kernel/liteos/cortex_a:default" ]
663  }
664
665  if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") {
666    default_compiler_configs += [
667      "//build/lite/config:security",
668      "//build/lite/config:exceptions",
669    ]
670  } else if (ohos_kernel_type == "liteos_m") {
671    default_compiler_configs += [ "//build/lite/config:stack_protector" ]
672  }
673
674  default_compiler_configs += [
675    "//build/lite/config:language_c",
676    "//build/lite/config:language_cpp",
677    "//build/lite/config:kernel_macros",
678  ]
679
680  default_shared_library_configs =
681      default_compiler_configs + [ "//build/lite/config:shared_library_config" ]
682  default_static_library_configs = default_compiler_configs
683  default_executable_configs = default_compiler_configs
684  if (ohos_kernel_type != "liteos_m") {
685    default_static_library_configs +=
686        [ "//build/lite/config:static_pie_config" ]
687    default_executable_configs += [ "//build/lite/config:static_pie_config" ]
688    default_executable_configs +=
689        [ "//build/lite/config:pie_executable_config" ]
690  }
691  default_executable_configs += [ "//build/lite/config:board_exe_ld_flags" ]
692}
693
694set_defaults("executable") {
695  configs = default_executable_configs
696}
697
698set_defaults("static_library") {
699  configs = default_static_library_configs
700}
701
702set_defaults("shared_library") {
703  configs = default_shared_library_configs
704}
705
706set_defaults("source_set") {
707  configs = default_compiler_configs
708}
709
710# Sets default dependencies for executable and shared_library targets.
711#
712# Variables
713#   no_default_deps: If true, no standard dependencies will be added.
714target_type_list = [
715  "executable",
716  "loadable_module",
717  "shared_library",
718  "static_library",
719  "source_set",
720]
721
722foreach(_target_type, target_type_list) {
723  template(_target_type) {
724    target(_target_type, target_name) {
725      forward_variables_from(invoker, "*", [ "no_default_deps" ])
726      if (!defined(deps)) {
727        deps = []
728      }
729      if (!defined(invoker.no_default_deps) || !invoker.no_default_deps) {
730        if (is_lite_system) {
731          deps += [ "//prebuilts/lite/sysroot" ]
732        } else {
733          deps += [ "//build/config:${_target_type}_deps" ]
734        }
735      }
736    }
737  }
738}
739
740if (is_lite_system) {
741  _target_type_list = [
742    "action",
743    "action_foreach",
744  ]
745
746  foreach(_target_type, _target_type_list) {
747    template(_target_type) {
748      target(_target_type, target_name) {
749        forward_variables_from(invoker, "*", [ "no_default_deps" ])
750        if (!defined(deps)) {
751          deps = []
752        }
753        if (!defined(invoker.no_default_deps) || !invoker.no_default_deps) {
754          deps += [ "//prebuilts/lite/sysroot" ]
755        }
756      }
757    }
758  }
759}
760