tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

chrome_build.gni (3076B)


      1 # Copyright 2015 The Chromium Authors
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 declare_args() {
      6   # Select the desired branding flavor. False means normal Chromium branding,
      7   # true means official Google Chrome branding (requires extra Google-internal
      8   # resources).
      9   is_chrome_branded = false
     10 
     11   # Whether to enable the Chrome for Testing (CfT) flavor. This arg is not
     12   # compatible with `is_chrome_branded`.
     13   #
     14   # Design document: https://goo.gle/chrome-for-testing
     15   is_chrome_for_testing = false
     16 
     17   # Whether to use internal Chrome for Testing (CfT).
     18   # Requires `src-internal/` and `is_chrome_for_testing = true`.
     19   #
     20   # When true, use Google-internal icons, otherwise fall back to Chromium icons.
     21   is_chrome_for_testing_branded = false
     22 
     23   # Set to true to enable settings for high end Android devices, typically
     24   # enhancing speed at the expense of resources such as binary sizes and memory.
     25   is_high_end_android = target_cpu == "arm64" || target_cpu == "x64"
     26 
     27   # Set to true to set defaults that enable features on Android that are more
     28   # typically available on desktop.
     29   is_desktop_android = false
     30 
     31   if (is_android) {
     32     # By default, Trichrome channels are compiled using separate package names.
     33     # Set this to 'true' to compile Trichrome channels using the Stable channel's
     34     # package name. This currently only affects builds with `android_channel =
     35     # "beta"`.
     36     use_stable_package_name_for_trichrome = false
     37   }
     38 }
     39 
     40 # Ensure !is_android implies !is_high_end_android.
     41 is_high_end_android = is_high_end_android && is_android
     42 
     43 if (is_desktop_android) {
     44   assert(target_os == "android",
     45          "Target must be Android to use is_desktop_android.")
     46 
     47   # Disable for non-android secondary toolchains.
     48   is_desktop_android = is_android
     49 }
     50 
     51 declare_args() {
     52   # Whether to apply size->speed trade-offs to the secondary toolchain.
     53   # Relevant only for 64-bit target_cpu.
     54   is_high_end_android_secondary_toolchain = false
     55 }
     56 
     57 assert(!is_chrome_for_testing || !is_chrome_branded,
     58        "`is_chrome_for_testing` is incompatible with `is_chrome_branded`")
     59 
     60 assert(is_chrome_for_testing || !is_chrome_for_testing_branded,
     61        "`is_chrome_for_testing_branded` requires `is_chrome_for_testing`")
     62 
     63 declare_args() {
     64   # Refers to the subdirectory for branding in various places including
     65   # chrome/app/theme.
     66   #
     67   # `branding_path_product` must not contain slashes.
     68   if (is_chrome_for_testing) {
     69     if (is_chrome_for_testing_branded) {
     70       branding_path_component = "google_chrome/google_chrome_for_testing"
     71     } else {
     72       branding_path_component = "chromium"
     73     }
     74     branding_path_product = "chromium"
     75   } else if (is_chrome_branded) {
     76     branding_path_component = "google_chrome"
     77     branding_path_product = "google_chrome"
     78   } else {
     79     branding_path_component = "chromium"
     80     branding_path_product = "chromium"
     81   }
     82 }
     83 
     84 declare_args() {
     85   # The path to the BRANDING file in chrome/app/theme.
     86   branding_file_path = "//chrome/app/theme/$branding_path_component/BRANDING"
     87 }