[go: nahoru, domu]

Move deps and data_deps out of chrome group.

Bug: 1146571
Change-Id: Ic77be2e669d60fd997078472f8decd341271ef16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2569786
Commit-Queue: Sajjad Mirza <sajjadm@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Auto-Submit: Sajjad Mirza <sajjadm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832988}
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 6602ff2..f403cf4 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -111,13 +111,19 @@
   group("chrome") {
     public_deps = [ ":chrome_initial" ]
     data_deps = [ ":chrome_initial" ]
+
+    # Do not add any more deps or data_deps to group("chrome").
+    # Because chrome_initial sets its output name to "chrome", running commands
+    # such as `ninja chrome` causes chrome_initial to be built instead. All
+    # deps and data_deps should be added to the chrome_initial target instead.
+    # Targets added here can only be built by explicitly using //chrome:chrome.
+    # Windows-only deps are OK because chrome_initial uses initialexe/chrome as
+    # the output name for that platform.
+    # See crbug.com/1146571.
     if (is_win) {
       public_deps += [ ":reorder_imports" ]
       data_deps += [ ":reorder_imports" ]
     }
-    if (is_chromeos) {
-      data_deps += [ "//sandbox/linux:chrome_sandbox" ]
-    }
   }
 
   executable("chrome_initial") {
@@ -137,6 +143,10 @@
     data = [ "$root_out_dir/resources.pak" ]
     data_deps = []
 
+    if (is_chromeos) {
+      data_deps += [ "//sandbox/linux:chrome_sandbox" ]
+    }
+
     if (chromeos_is_browser_only && also_build_ash_chrome) {
       data_deps += [ "//chrome:chrome(//build/toolchain/linux:ash_clang_x64)" ]
     }