From d1e190d78a2084aa849819a8921d76e8dfe67e19 Mon Sep 17 00:00:00 2001 From: dgn Date: Fri, 17 Mar 2017 06:34:49 -0700 Subject: [PATCH] [Android] Add enable_chrome_android_internal GN flag This flag will allow devs having access to the internal Chrome for Android repo to choose whether to use it in their builds. BUG=702323 Review-Url: https://codereview.chromium.org/2753273002 Cr-Commit-Position: refs/heads/master@{#457749} --- BUILD.gn | 2 +- build/config/android/config.gni | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 8f84ca3c4baba1..4ecf89ca262b2e 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -322,7 +322,7 @@ group("gn_all") { ] } - if (has_chrome_android_internal) { + if (enable_chrome_android_internal) { deps += [ "//clank" ] } } diff --git a/build/config/android/config.gni b/build/config/android/config.gni index 2f68c894eb1b36..a9ff7c46aded78 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni @@ -12,7 +12,19 @@ if (is_android) { [ rebase_path("//clank", root_build_dir) ], "string") == "True" - if (has_chrome_android_internal) { + # We are using a separate declare_args block for only this argument so that + # we can decide if we have to pull in definitions from the internal config + # early. + declare_args() { + # Enables using the internal Chrome for Android repository. The default + # value depends on whether the repository is available, and if it's not but + # this argument is manually set to True, the generation will fail. + # The main purpose of this argument is to avoid having to maintain 2 + # repositories to support both public only and internal builds. + enable_chrome_android_internal = has_chrome_android_internal + } + + if (enable_chrome_android_internal) { import("//clank/config.gni") }