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  blink_asserts_always_on = false
30}
31
32use_default_render_theme = use_aura
33
34# Whether Android ARM or x86 build uses OpenMAX DL FFT. Currently only
35# supported on Android ARMv7+, ia32 or x64 without webview. When enabled, this
36# will also enable WebAudio support on Android ARM, ia32 and x64. Default is
37# enabled. Whether WebAudio is actually available depends on runtime settings
38# and flags.
39use_openmax_dl_fft = is_android && !is_android_webview_build &&
40  (cpu_arch == "x86" ||
41   cpu_arch == "x64" ||
42   (cpu_arch == "arm" && arm_version >= 7))
43
44use_webaudio_ffmpeg = !is_mac && !is_android
45
46# Set this to true to enable use of concatenated impulse responses for the HRTF
47# panner in WebAudio.
48# TODO(brettw) do we need this or can we assume its always on?
49use_concatenated_impulse_responses = true
50
51# feature_defines_list ---------------------------------------------------------
52
53feature_defines_list = [
54  "ENABLE_SVG_FONTS=1",
55]
56
57if (is_debug) {
58  # TODO(GYP) this should also be set when release_valgrind_build is set,
59  # but we don't have that flag in the GN build yet.
60  feature_defines_list += [ "WTF_USE_DYNAMIC_ANNOTATIONS=1" ]
61}
62
63if (use_concatenated_impulse_responses) {
64  feature_defines_list += [ "WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1" ]
65}
66
67if (!is_android) {
68  feature_defines_list += [
69    "ENABLE_INPUT_MULTIPLE_FIELDS_UI=1",
70    "ENABLE_WEB_AUDIO=1",
71  ]
72}
73
74if (use_webaudio_ffmpeg) {
75  feature_defines_list += [ "WTF_USE_WEBAUDIO_FFMPEG=1" ]
76}
77
78if (use_openmax_dl_fft) {
79  feature_defines_list += [
80    "WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1",
81    # Enabling the FFT is enough to enable WebAudio support to
82    # allow most WebAudio features to work on Android.
83    "ENABLE_WEB_AUDIO=1",
84  ]
85}
86
87if (!is_mac) {
88  # Mac OS X has not implemented support for ENABLE(OPENTYPE_VERTICAL) yet.
89  feature_defines_list += [ "ENABLE_OPENTYPE_VERTICAL=1" ]
90}
91
92if (use_default_render_theme) {
93  feature_defines_list += [ "WTF_USE_DEFAULT_RENDER_THEME=1" ]
94}
95if (enable_oilpan) {
96  feature_defines_list += [ "ENABLE_OILPAN=1" ]
97}
98if (blink_asserts_always_on) {
99  feature_defines_list += [ "ENABLE_ASSERT=1" ]
100}
101
102# feature_defines_string -------------------------------------------------------
103
104# Convert the list to a space-separated string for passing to scripts.
105# This would be the equivalent of passing '<(feature_defines)' in GYP.
106feature_defines_string = exec_script(
107    "build/gn_list_to_space_separated_string.py",
108    feature_defines_list,
109    "trim string")
110