| # Copyright 2014 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/compiler/compiler.gni") |
| import("//build/config/ui.gni") |
| import("//build/toolchain/gcc_toolchain.gni") |
| import("//third_party/blink/public/public_features.gni") |
| |
| if (is_android) { |
| import("//build/config/android/config.gni") |
| } |
| if (current_cpu == "arm") { |
| import("//build/config/arm.gni") |
| } |
| |
| declare_args() { |
| # If true, use PFFFT for WebAudio FFT support. Do not use for Mac because the |
| # FFT library there is much faster. |
| use_webaudio_pffft = target_os != "mac" |
| } |
| |
| declare_args() { |
| # Format the generated files to improve the code readability. Apply clang- |
| # format, gn format, etc. to the generated files if possible. |
| blink_enable_generated_code_formatting = false |
| |
| # How many symbols to include in the build of blink. This affects |
| # the performance of the build since the symbols are large and dealing with |
| # them is slow. |
| # 2 means regular build with symbols. |
| # 1 means medium symbols, usually enough for backtraces only. Symbols with |
| # internal linkage (static functions or those in anonymous namespaces) may not |
| # appear when using this level. On some platforms (including Windows) |
| # filenames and line numbers will be included. Information about types and |
| # locals is not included. |
| # 0 means minimal symbols, which on some platforms (including Windows) may |
| # include function names suitable for backtraces. |
| # -1 means auto-set according to debug/release and platform. |
| blink_symbol_level = -1 |
| |
| # If true, the experimental renderer extensions library will be used. |
| use_blink_extensions_chromeos = is_chromeos |
| |
| # If true, the WebView renderer extensions library will be used. |
| # |
| # Android WebView and Chrome on Android both use the same build configuration |
| # for Blink, and may use a common installation of the Blink libraries on a |
| # device. There is no precise concept of "is_webview". As such, Chrome on |
| # Android technically has the WebView extensions available in its version of |
| # Blink; however, the extensions are default-disabled. Chrome (and any other |
| # non-WebView products) should never attempt to enable the extensions at |
| # runtime. |
| use_blink_extensions_webview = is_android |
| } |
| |
| # feature_defines_list --------------------------------------------------------- |
| |
| feature_defines_list = [] |
| |
| if (use_blink_extensions_chromeos) { |
| feature_defines_list += [ "USE_BLINK_EXTENSIONS_CHROMEOS=1" ] |
| } |
| |
| if (use_blink_extensions_webview) { |
| feature_defines_list += [ "USE_BLINK_EXTENSIONS_WEBVIEW=1" ] |
| } |
| |
| if (use_webaudio_pffft) { |
| feature_defines_list += [ "WTF_USE_WEBAUDIO_PFFFT=1" ] |
| } |
| |
| if (blink_symbol_level == 2) { |
| blink_symbols_config = [ "//build/config/compiler:symbols" ] |
| } else if (blink_symbol_level == 1) { |
| blink_symbols_config = [ "//build/config/compiler:minimal_symbols" ] |
| } else if (blink_symbol_level == 0) { |
| blink_symbols_config = [ "//build/config/compiler:no_symbols" ] |
| } else { |
| blink_symbols_config = [ "//build/config/compiler:default_symbols" ] |
| } |
| |
| # Record whether target_os (rather than current_os) is android, for the case of |
| # generating the v8 context snapshot for android. When generating the snapshot |
| # for android, blink is compiled with current_os="linux" and |
| # target_os="android". Using target_os is necessary as we need to compile in the |
| # same way as would happen when current_os="android". |
| target_os_is_android = target_os == "android" |