Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / build / config / BUILDCONFIG.gn
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 # BUILD FLAGS
7 # =============================================================================
8 #
9 # This block lists input arguments to the build, along with their default
10 # values. GN requires listing them explicitly so it can validate input and have
11 # a central place to manage the build flags.
12 #
13 # If a value is specified on the command line, it will overwrite the defaults
14 # given here, otherwise the default will be injected into the root scope.
15 #
16 # KEEP IN ALPHABETICAL ORDER and write a good description for everything.
17 # Use "is_*" names for intrinsic platform descriptions and build modes, and
18 # "use_*" names for optional features libraries, and configurations.
19 declare_args() {
20   # How many symbols to include in the build. This affects the performance of
21   # the build since the symbols are large and dealing with them is slow.
22   #   2 means regular build with symbols.
23   #   1 means minimal symbols, usually enough for backtraces only.
24   #   0 means no symbols.
25   #   -1 means auto-set (off in release, regular in debug).
26   symbol_level = -1
27
28   # Component build.
29   is_component_build = false
30   # Debug build.
31   is_debug = true
32
33   # Set to true when compiling with the Clang compiler. Typically this is used
34   # to configure warnings.
35   is_clang = (os == "mac" || os == "ios" || os == "linux" || os == "chromeos")
36
37   # Forces a 64-bit build on Windows. Does nothing on other platforms. Normally
38   # we build 32-bit on Windows regardless of the current host OS bit depth.
39   # Setting this flag will override this logic and generate 64-bit toolchains.
40   #
41   # Normally this would get set automatically when you specify a target using
42   # the 64-bit toolchain. You can also set this on the command line to convert
43   # the default toolchain to 64-bit.
44   force_win64 = false
45
46   # Selects the desired build flavor. Official builds get additional
47   # processing to prepare for release. Normally you will want to develop and
48   # test with this flag off.
49   is_official_build = false
50
51   # Select the desired branding flavor. False means normal Chromium branding,
52   # true means official Google Chrome branding (requires extra Google-internal
53   # resources).
54   is_chrome_branded = false
55
56   # Compile for Address Sanitizer to find memory bugs.
57   is_asan = false
58
59   # Compile for Leak Sanitizer to find leaks.
60   is_lsan = false
61
62   # Compile for Memory Sanitizer to find uninitialized reads.
63   is_msan = false
64
65   # Compile for Thread Sanitizer to find threading bugs.
66   is_tsan = false
67
68   if (os == "chromeos") {
69     # Allows the target toolchain to be injected as arguments. This is needed
70     # to support the CrOS build system which supports per-build-configuration
71     # toolchains.
72     cros_use_custom_toolchain = false
73   }
74
75   # TODO(cjhopman): Make target_arch work for all platforms.
76
77   # Architecture of the target device. For Android builds, this will be equal to
78   # the cpu_arch of the default toolchain. When checking the CPU architecture
79   # for source files and build dependencies you should almost alway use cpu_arch
80   # instead. cpu_arch is the architecture of the current toolchain and allows
81   # cross-compiles (compiling the same target for multiple toolchains in the
82   # same build) to work.
83   target_arch = "arm"
84 }
85
86 # =============================================================================
87 # OS DEFINITIONS
88 # =============================================================================
89 #
90 # We set these various is_FOO booleans for convenience in writing OS-based
91 # conditions.
92 #
93 # - is_android, is_chromeos, is_ios, and is_win should be obvious.
94 # - is_mac is set only for desktop Mac. It is not set on iOS.
95 # - is_posix is true for mac and any Unix-like system (basically everything
96 #   except Windows).
97 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is
98 #   generally too different despite being based on the Linux kernel).
99 #
100 # Do not add more is_* variants here for random lesser-used Unix systems like
101 # aix or one of the BSDs. If you need to check these, just check the os value
102 # directly.
103
104 if (os == "win") {
105   is_android = false
106   is_chromeos = false
107   is_ios = false
108   is_linux = false
109   is_mac = false
110   is_nacl = false
111   is_posix = false
112   is_win = true
113 } else if (os == "mac") {
114   is_android = false
115   is_chromeos = false
116   is_ios = false
117   is_linux = false
118   is_mac = true
119   is_nacl = false
120   is_posix = true
121   is_win = false
122 } else if (os == "android") {
123   is_android = true
124   is_chromeos = false
125   is_ios = false
126   is_linux = false
127   is_mac = false
128   is_nacl = false
129   is_posix = true
130   is_win = false
131 } else if (os == "chromeos") {
132   is_android = false
133   is_chromeos = true
134   is_ios = false
135   is_linux = true
136   is_mac = false
137   is_nacl = false
138   is_posix = true
139   is_win = false
140 } else if (os == "nacl") {
141   # os == "nacl" will be passed by the nacl toolchain definition. It is not
142   # set by default or on the command line. We treat is as a Posix variant.
143   is_android = false
144   is_chromeos = false
145   is_ios = false
146   is_linux = false
147   is_mac = false
148   is_nacl = true
149   is_posix = true
150   is_win = false
151 } else if (os == "ios") {
152   is_android = false
153   is_chromeos = false
154   is_ios = true
155   is_linux = false
156   is_mac = false
157   is_nacl = false
158   is_posix = true
159   is_win = false
160 } else if (os == "linux") {
161   is_android = false
162   is_chromeos = false
163   is_ios = false
164   is_linux = true
165   is_mac = false
166   is_nacl = false
167   is_posix = true
168   is_win = false
169 }
170
171 is_desktop_linux = is_linux && !is_chromeos
172
173 # =============================================================================
174 # CPU ARCHITECTURE
175 # =============================================================================
176
177 if (is_win) {
178   # Always use 32-bit on Windows, even when compiling on a 64-bit host OS,
179   # unless the override flag is specified.
180   if (force_win64) {
181     cpu_arch = "x64"
182   } else {
183     cpu_arch = "x86"
184   }
185 }
186
187 if (is_android) {
188   # TODO(cjhopman): enable this assert once bots are updated to not set
189   # cpu_arch.
190   #assert(cpu_arch == build_cpu_arch, "Android device target architecture should
191   #    be set with 'target_arch', not 'cpu_arch'")
192   cpu_arch = target_arch
193 }
194
195 # =============================================================================
196 # SOURCES FILTERS
197 # =============================================================================
198 #
199 # These patterns filter out platform-specific files when assigning to the
200 # sources variable. The magic variable |sources_assignment_filter| is applied
201 # to each assignment or appending to the sources variable and matches are
202 # automatcally removed.
203 #
204 # Note that the patterns are NOT regular expressions. Only "*" and "\b" (path
205 # boundary = end of string or slash) are supported, and the entire string
206 # muct match the pattern (so you need "*.cc" to match all .cc files, for
207 # example).
208
209 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
210 # below.
211 sources_assignment_filter = []
212 if (!is_posix) {
213   sources_assignment_filter += [
214     "*_posix.h",
215     "*_posix.cc",
216     "*_posix_unittest.h",
217     "*_posix_unittest.cc",
218     "*\bposix/*",
219   ]
220 }
221 if (!is_win) {
222   sources_assignment_filter += [
223     "*_win.cc",
224     "*_win.h",
225     "*_win_unittest.cc",
226     "*\bwin/*",
227     "*.rc",
228   ]
229 }
230 if (!is_mac) {
231   sources_assignment_filter += [
232     "*_mac.h",
233     "*_mac.cc",
234     "*_mac.mm",
235     "*_mac_unittest.h",
236     "*_mac_unittest.cc",
237     "*_mac_unittest.mm",
238     "*\bmac/*",
239     "*_cocoa.h",
240     "*_cocoa.cc",
241     "*_cocoa.mm",
242     "*_cocoa_unittest.h",
243     "*_cocoa_unittest.cc",
244     "*_cocoa_unittest.mm",
245     "*\bcocoa/*",
246   ]
247 }
248 if (!is_ios) {
249   sources_assignment_filter += [
250     "*_ios.h",
251     "*_ios.cc",
252     "*_ios.mm",
253     "*_ios_unittest.h",
254     "*_ios_unittest.cc",
255     "*_ios_unittest.mm",
256     "*\bios/*",
257   ]
258 }
259 if (!is_mac && !is_ios) {
260   sources_assignment_filter += [
261     "*.mm",
262   ]
263 }
264 if (!is_linux) {
265   sources_assignment_filter += [
266     "*_linux.h",
267     "*_linux.cc",
268     "*_linux_unittest.h",
269     "*_linux_unittest.cc",
270     "*\blinux/*",
271   ]
272 }
273 if (!is_android) {
274   sources_assignment_filter += [
275     "*_android.h",
276     "*_android.cc",
277     "*_android_unittest.h",
278     "*_android_unittest.cc",
279     "*\bandroid/*",
280   ]
281 }
282 if (!is_chromeos) {
283   sources_assignment_filter += [
284     "*_chromeos.h",
285     "*_chromeos.cc",
286     "*_chromeos_unittest.h",
287     "*_chromeos_unittest.cc",
288     "*\bchromeos/*",
289   ]
290 }
291 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
292 # below.
293
294 # Actually save this list.
295 #
296 # These patterns are executed for every file in the source tree of every run.
297 # Therefore, adding more patterns slows down the build for everybody. We should
298 # only add automatic patterns for configurations affecting hundreds of files
299 # across many projects in the tree.
300 #
301 # Therefore, we only add rules to this list corresponding to platforms on the
302 # Chromium waterfall.  This is not for non-officially-supported platforms
303 # (FreeBSD, etc.) toolkits, (X11, GTK, etc.), or features. For these cases,
304 # write a conditional in the target to remove the file(s) from the list when
305 # your platform/toolkit/feature doesn't apply.
306 set_sources_assignment_filter(sources_assignment_filter)
307
308 # =============================================================================
309 # BUILD OPTIONS
310 # =============================================================================
311
312 # These Sanitizers all imply using the Clang compiler. On Windows they either
313 # don't work or work differently.
314 if (!is_clang && (is_asan || is_lsan || is_tsan || is_msan)) {
315   is_clang = true
316 }
317
318 # =============================================================================
319 # TARGET DEFAULTS
320 # =============================================================================
321 #
322 # Set up the default configuration for every build target of the given type.
323 # The values configured here will be automatically set on the scope of the
324 # corresponding target. Target definitions can add or remove to the settings
325 # here as needed.
326
327 # Holds all configs used for making native executables and libraries, to avoid
328 # duplication in each target below.
329 _native_compiler_configs = [
330   "//build/config:feature_flags",
331
332   "//build/config/compiler:compiler",
333   "//build/config/compiler:compiler_arm_fpu",
334   "//build/config/compiler:chromium_code",
335   "//build/config/compiler:default_include_dirs",
336   "//build/config/compiler:default_warnings",
337   "//build/config/compiler:no_rtti",
338   "//build/config/compiler:runtime_library",
339 ]
340 if (is_win) {
341   _native_compiler_configs += [
342     "//build/config/win:lean_and_mean",
343     "//build/config/win:nominmax",
344     "//build/config/win:sdk",
345     "//build/config/win:unicode",
346     "//build/config/win:winver",
347   ]
348 }
349 if (is_posix) {
350   _native_compiler_configs += [
351     "//build/config/gcc:no_exceptions",
352     "//build/config/gcc:symbol_visibility_hidden",
353   ]
354 }
355
356 if (is_linux) {
357   _native_compiler_configs += [ "//build/config/linux:sdk", ]
358 } else if (is_mac) {
359   _native_compiler_configs += [ "//build/config/mac:sdk", ]
360 } else if (is_ios) {
361   _native_compiler_configs += [ "//build/config/ios:sdk", ]
362 } else if (is_android) {
363   _native_compiler_configs += [ "//build/config/android:sdk", ]
364 }
365
366 if (is_clang) {
367   _native_compiler_configs += [
368     "//build/config/clang:find_bad_constructs",
369     "//build/config/clang:extra_warnings",
370   ]
371 }
372
373 # Optimizations and debug checking.
374 if (is_debug) {
375   _native_compiler_configs += [ "//build/config:debug" ]
376   _default_optimization_config = "//build/config/compiler:no_optimize"
377 } else {
378   _native_compiler_configs += [ "//build/config:release" ]
379   _default_optimization_config = "//build/config/compiler:optimize"
380 }
381 _native_compiler_configs += [ _default_optimization_config ]
382
383 # If it wasn't manually set, set to an appropriate default.
384 if (symbol_level == -1) {
385   # Linux is slowed by having symbols as part of the target binary, whereas
386   # Mac and Windows have them separate, so in Release Linux, default them off.
387   if (is_debug || !is_linux) {
388     symbol_level = 2
389   } else {
390     symbol_level = 0
391   }
392 }
393
394 # Symbol setup.
395 if (symbol_level == 2) {
396   _default_symbols_config = "//build/config/compiler:symbols"
397 } else if (symbol_level == 1) {
398   _default_symbols_config = "//build/config/compiler:minimal_symbols"
399 } else if (symbol_level == 0) {
400   _default_symbols_config = "//build/config/compiler:no_symbols"
401 } else {
402   assert(false, "Bad value for symbol_level.")
403 }
404 _native_compiler_configs += [ _default_symbols_config ]
405
406 # Windows linker setup for EXEs and DLLs.
407 if (is_win) {
408   if (is_debug) {
409     _default_incremental_linking_config =
410       "//build/config/win:incremental_linking"
411   } else {
412     _default_incremental_linking_config =
413       "//build/config/win:no_incremental_linking"
414   }
415   _windows_linker_configs = [
416     _default_incremental_linking_config,
417     "//build/config/win:sdk_link",
418     "//build/config/win:common_linker_setup",
419     # Default to console-mode apps. Most of our targets are tests and such
420     # that shouldn't use the windows subsystem.
421     "//build/config/win:console",
422   ]
423 }
424
425 # Executable defaults.
426 _executable_configs = _native_compiler_configs + [
427   "//build/config:default_libs",
428 ]
429 if (is_win) {
430   _executable_configs += _windows_linker_configs
431 } else if (is_mac) {
432   _executable_configs += [
433     "//build/config/mac:mac_dynamic_flags",
434     "//build/config/mac:mac_executable_flags" ]
435 } else if (is_linux || is_android) {
436   _executable_configs += [ "//build/config/gcc:executable_ldconfig" ]
437   if (is_android) {
438     _executable_configs += [ "//build/config/android:executable_config" ]
439   }
440 }
441 set_defaults("executable") {
442   configs = _executable_configs
443 }
444
445 # Static library defaults.
446 set_defaults("static_library") {
447   configs = _native_compiler_configs
448 }
449
450 # Shared library defaults (also for components in component mode).
451 _shared_library_configs = _native_compiler_configs + [
452   "//build/config:default_libs",
453 ]
454 if (is_win) {
455   _shared_library_configs += _windows_linker_configs
456 } else if (is_mac) {
457   _shared_library_configs += [ "//build/config/mac:mac_dynamic_flags" ]
458 }
459 set_defaults("shared_library") {
460   configs = _shared_library_configs
461 }
462 if (is_component_build) {
463   set_defaults("component") {
464     configs = _shared_library_configs
465   }
466 }
467
468 # Source set defaults (also for components in non-component mode).
469 set_defaults("source_set") {
470   configs = _native_compiler_configs
471 }
472 if (!is_component_build) {
473   set_defaults("component") {
474     configs = _native_compiler_configs
475   }
476 }
477
478 # Test defaults.
479 set_defaults("test") {
480   if (is_android) {
481     configs = _shared_library_configs
482   } else {
483     configs = _executable_configs
484   }
485 }
486
487
488 # ==============================================================================
489 # TOOLCHAIN SETUP
490 # ==============================================================================
491 #
492 # Here we set the default toolchain, as well as the variable host_toolchain
493 # which will identify the toolchain corresponding to the local system when
494 # doing cross-compiles. When not cross-compiling, this will be the same as the
495 # default toolchain.
496
497 if (is_win) {
498   # TODO(brettw) name the toolchains the same as cpu_arch as with Linux below
499   # to eliminate these conditionals.
500   if (build_cpu_arch == "x64") {
501     host_toolchain = "//build/toolchain/win:64"
502   } else if (build_cpu_arch == "x86") {
503     host_toolchain = "//build/toolchain/win:32"
504   }
505
506   if (cpu_arch == "x64") {
507     set_default_toolchain("//build/toolchain/win:64")
508   } else if (cpu_arch == "x86") {
509     set_default_toolchain("//build/toolchain/win:32")
510   }
511 } else if (is_android) {
512   # Use clang for the x86/64 Linux host builds.
513   if (build_cpu_arch == "x86" || build_cpu_arch == "x64") {
514     host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch"
515   } else {
516     host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
517   }
518   set_default_toolchain("//build/toolchain/android:$cpu_arch")
519 } else if (is_linux) {
520   if (is_clang) {
521     host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch"
522     set_default_toolchain("//build/toolchain/linux:clang_$cpu_arch")
523   } else {
524     host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
525     set_default_toolchain("//build/toolchain/linux:$cpu_arch")
526   }
527   if (is_chromeos && cros_use_custom_toolchain) {
528     set_default_toolchain("//build/toolchain/cros:target")
529   }
530 } else if (is_mac) {
531   host_toolchain = "//build/toolchain/mac:clang"
532   set_default_toolchain(host_toolchain)
533 } else if (is_ios) {
534   host_toolchain = "//build/toolchain/mac:host_clang"
535   set_default_toolchain("//build/toolchain/mac:clang")
536 }
537
538 # ==============================================================================
539 # COMPONENT SETUP
540 # ==============================================================================
541
542 # TODO(brettw) erase this once the built-in "component" function is removed.
543 if (is_component_build) {
544   component_mode = "shared_library"
545 } else {
546   component_mode = "source_set"
547 }
548
549 template("component") {
550   if (is_component_build) {
551     shared_library(target_name) {
552       # Configs will always be defined since we set_defaults for a component
553       # above. We want to use those rather than whatever came with the nested
554       # shared/static library inside the component.
555       configs = []  # Prevent list overwriting warning.
556       configs = invoker.configs
557
558       # The sources assignment filter will have already been applied when the
559       # code was originally executed. We don't want to apply it again, since
560       # the original target may have override it for some assignments.
561       set_sources_assignment_filter([])
562
563       if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs }
564       if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from }
565       if (defined(invoker.cflags)) { cflags = invoker.cflags }
566       if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c }
567       if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc }
568       if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc }
569       if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc }
570       if (defined(invoker.check_includes)) { check_includes = invoker.check_includes }
571       if (defined(invoker.data)) { data = invoker.data }
572       if (defined(invoker.datadeps)) { datadeps = invoker.datadeps }
573       if (defined(invoker.defines)) { defines = invoker.defines }
574       # All shared libraries must have the sanitizer deps to properly link in
575       # asan mode (this target will be empty in other cases).
576       if (defined(invoker.deps)) {
577         deps = invoker.deps + [ "//build/config/sanitizers:deps" ]
578       } else {
579         deps = [ "//build/config/sanitizers:deps" ]
580       }
581       if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs }
582       if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from }
583       if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs }
584       if (defined(invoker.ldflags)) { ldflags = invoker.ldflags }
585       if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs }
586       if (defined(invoker.libs)) { libs = invoker.libs }
587       if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
588       if (defined(invoker.output_name)) { output_name = invoker.output_name }
589       if (defined(invoker.public)) { public = invoker.public }
590       if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
591       if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
592       if (defined(invoker.sources)) { sources = invoker.sources }
593       if (defined(invoker.testonly)) { testonly = invoker.testonly }
594       if (defined(invoker.visibility)) { visibility = invoker.visibility }
595     }
596   } else {
597     source_set(target_name) {
598       # See above.
599       configs = []  # Prevent list overwriting warning.
600       configs = invoker.configs
601
602       # See above call.
603       set_sources_assignment_filter([])
604
605       if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs }
606       if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from }
607       if (defined(invoker.cflags)) { cflags = invoker.cflags }
608       if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c }
609       if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc }
610       if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc }
611       if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc }
612       if (defined(invoker.check_includes)) { check_includes = invoker.check_includes }
613       if (defined(invoker.data)) { data = invoker.data }
614       if (defined(invoker.datadeps)) { datadeps = invoker.datadeps }
615       if (defined(invoker.defines)) { defines = invoker.defines }
616       if (defined(invoker.deps)) { deps = invoker.deps }
617       if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs }
618       if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from }
619       if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs }
620       if (defined(invoker.ldflags)) { ldflags = invoker.ldflags }
621       if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs }
622       if (defined(invoker.libs)) { libs = invoker.libs }
623       if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
624       if (defined(invoker.output_name)) { output_name = invoker.output_name }
625       if (defined(invoker.public)) { public = invoker.public }
626       if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
627       if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
628       if (defined(invoker.sources)) { sources = invoker.sources }
629       if (defined(invoker.testonly)) { testonly = invoker.testonly }
630       if (defined(invoker.visibility)) { visibility = invoker.visibility }
631     }
632   }
633 }
634
635 # ==============================================================================
636 # TEST SETUP
637 # ==============================================================================
638
639 # Define a test as an executable (or shared_library on Android) with the
640 # "testonly" flag set.
641 template("test") {
642   if (is_android) {
643     shared_library(target_name) {
644       # Configs will always be defined since we set_defaults for a component
645       # above. We want to use those rather than whatever came with the nested
646       # shared/static library inside the component.
647       configs = []  # Prevent list overwriting warning.
648       configs = invoker.configs
649
650       # See above call.
651       set_sources_assignment_filter([])
652
653       testonly = true
654
655       if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs }
656       if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from }
657       if (defined(invoker.cflags)) { cflags = invoker.cflags }
658       if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c }
659       if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc }
660       if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc }
661       if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc }
662       if (defined(invoker.check_includes)) { check_includes = invoker.check_includes }
663       if (defined(invoker.data)) { data = invoker.data }
664       if (defined(invoker.datadeps)) { datadeps = invoker.datadeps }
665       if (defined(invoker.defines)) { defines = invoker.defines }
666       if (defined(invoker.deps)) { deps = invoker.deps }
667       if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs }
668       if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from }
669       if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs }
670       if (defined(invoker.ldflags)) { ldflags = invoker.ldflags }
671       if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs }
672       if (defined(invoker.libs)) { libs = invoker.libs }
673       if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
674       if (defined(invoker.output_name)) { output_name = invoker.output_name }
675       if (defined(invoker.public)) { public = invoker.public }
676       if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
677       if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
678       if (defined(invoker.sources)) { sources = invoker.sources }
679       if (defined(invoker.visibility)) { visibility = invoker.visibility }
680     }
681   } else {
682     executable(target_name) {
683       # See above.
684       configs = []  # Prevent list overwriting warning.
685       configs = invoker.configs
686
687       # See above call.
688       set_sources_assignment_filter([])
689
690       testonly = true
691
692       if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invoker.all_dependent_configs }
693       if (defined(invoker.allow_circular_includes_from)) { allow_circular_includes_from = invoker.allow_circular_includes_from }
694       if (defined(invoker.cflags)) { cflags = invoker.cflags }
695       if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c }
696       if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc }
697       if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc }
698       if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc }
699       if (defined(invoker.check_includes)) { check_includes = invoker.check_includes }
700       if (defined(invoker.data)) { data = invoker.data }
701       if (defined(invoker.datadeps)) { datadeps = invoker.datadeps }
702       if (defined(invoker.defines)) { defines = invoker.defines }
703       # All shared libraries must have the sanitizer deps to properly link in
704       # asan mode (this target will be empty in other cases).
705       if (defined(invoker.deps)) {
706         deps = invoker.deps + [ "//build/config/sanitizers:deps" ]
707       } else {
708         deps = [ "//build/config/sanitizers:deps" ]
709       }
710       if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs }
711       if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_configs_from = invoker.forward_dependent_configs_from }
712       if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs }
713       if (defined(invoker.ldflags)) { ldflags = invoker.ldflags }
714       if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs }
715       if (defined(invoker.libs)) { libs = invoker.libs }
716       if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
717       if (defined(invoker.output_name)) { output_name = invoker.output_name }
718       if (defined(invoker.public)) { public = invoker.public }
719       if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
720       if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
721       if (defined(invoker.sources)) { sources = invoker.sources }
722       if (defined(invoker.visibility)) { visibility = invoker.visibility }
723     }
724   }
725 }