• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2014 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
5import("//build/config/ui.gni")
6
7if (is_android) {
8  import("//build/config/android/config.gni")
9} else {
10  # TODO(brettw) remove this once && early-out is checked in.
11  is_android_webview_build = false
12}
13if (cpu_arch == "arm") {
14  import("//build/config/arm.gni")
15} else {
16  # TODO(brettw) remove this once && early-out is checked in.
17  arm_version = 0
18}
19
20declare_args() {
21  # Enables the Oilpan garbage-collection infrastructure.
22  enable_oilpan = false
23
24  # Set to true to enable the clang plugin that checks the usage of the Blink
25  # garbage-collection infrastructure during compilation.
26  blink_gc_plugin = false
27  blink_gc_plugin_dump_graph = false
28}
29
30use_default_render_theme = use_aura
31
32# Whether Android ARM or x86 build uses OpenMAX DL FFT. Currently only
33# supported on Android ARMv7+, ia32 or x64 without webview. When enabled, this
34# will also enable WebAudio support on Android ARM, ia32 and x64. Default is
35# enabled. Whether WebAudio is actually available depends on runtime settings
36# and flags.
37use_openmax_dl_fft = is_android && !is_android_webview_build &&
38  (cpu_arch == "x86" ||
39   cpu_arch == "x64" ||
40   (cpu_arch == "arm" && arm_version > 7))
41
42use_webaudio_ffmpeg = !is_mac && !is_android
43
44# Set this to true to enable use of concatenated impulse responses for the HRTF
45# panner in WebAudio.
46# TODO(brettw) do we need this or can we assume its always on?
47use_concatenated_impulse_responses = true
48
49# feature_defines_list ---------------------------------------------------------
50
51feature_defines_list = [
52  "ENABLE_CUSTOM_SCHEME_HANDLER=0",
53  "ENABLE_SVG_FONTS=1",
54]
55
56if (is_debug) {
57  # TODO(GYP) this should also be set when release_valgrind_build is set,
58  # but we don't have that flag in the GN build yet.
59  feature_defines_list += [ "WTF_USE_DYNAMIC_ANNOTATIONS=1" ]
60}
61
62if (use_concatenated_impulse_responses) {
63  feature_defines_list += [ "WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1" ]
64}
65
66if (is_android) {
67  feature_defines_list += [
68    "ENABLE_MEDIA_CAPTURE=1",
69  ]
70} else {
71  feature_defines_list += [
72    "ENABLE_INPUT_MULTIPLE_FIELDS_UI=1",
73    "ENABLE_MEDIA_CAPTURE=0",
74    "ENABLE_WEB_AUDIO=1",
75  ]
76}
77
78if (use_webaudio_ffmpeg) {
79  feature_defines_list += [ "WTF_USE_WEBAUDIO_FFMPEG=1" ]
80}
81
82if (use_openmax_dl_fft) {
83  feature_defines_list += [
84    "WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1",
85    # Enabling the FFT is enough to enable WebAudio support to
86    # allow most WebAudio features to work on Android.
87    "ENABLE_WEB_AUDIO=1",
88  ]
89}
90
91if (!is_mac) {
92  # Mac OS X has not implemented support for ENABLE(OPENTYPE_VERTICAL) yet.
93  feature_defines_list += [ "ENABLE_OPENTYPE_VERTICAL=1" ]
94}
95
96if (use_default_render_theme) {
97  feature_defines_list += [ "WTF_USE_DEFAULT_RENDER_THEME=1" ]
98}
99if (enable_oilpan) {
100  feature_defines_list += [ "ENABLE_OILPAN=1" ]
101}
102
103# feature_defines_string -------------------------------------------------------
104
105# Convert the list to a space-separated string for passing to scripts.
106# This would be the equivalent of passing '<(feature_defines)' in GYP.
107feature_defines_string = exec_script(
108    "build/gn_list_to_space_separated_string.py",
109    feature_defines_list,
110    "trim string")
111