Skip to content

Commit

Permalink
Allow generation of a chromium outdirs when enable_extensions=false
Browse files Browse the repository at this point in the history
This allows us at Opera to patch chromium a little less before
building a downstream product that doesn't depend on extensions.

At the moment, the 'chrome' target does not compile when
enable_extensions=false - and this is fine since Chrome indeed
needs extensions. But other browser products that use
enable_extensions=false can now generate an outdir without
getting complaints from GN.

BUG=725906

TEST=gn gen out/GnTest
TEST=gn gen --args='enable_extensions=false' out/GnTest
TEST=gn gen --args='is_component_build=true' out/GnTest
TEST=gn gen --args='is_component_build=true enable_extensions=false' out/GnTest
TEST=gn gen --args='target_os="android"' out/GnTest
TEST=gn gen --args='target_os="android" enable_extensions=false' out/GnTest
TEST=gn gen --args='target_os="chromeos"' out/GnTest
TEST=gn gen --args='target_os="chromeos" is_component_build=true' out/GnTest

Review-Url: https://codereview.chromium.org/2904443004
Cr-Commit-Position: refs/heads/master@{#479646}
  • Loading branch information
hugoh authored and Commit Bot committed Jun 15, 2017
1 parent 9c3619e commit f7a620c
Show file tree
Hide file tree
Showing 69 changed files with 365 additions and 47 deletions.
68 changes: 34 additions & 34 deletions apps/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,47 @@ import("//build/config/ui.gni")
import("//extensions/features/features.gni")

assert(!is_android && !is_ios)
assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

static_library("apps") {
sources = []

if (enable_extensions) {
sources += [
"app_lifetime_monitor.cc",
"app_lifetime_monitor.h",
"app_lifetime_monitor_factory.cc",
"app_lifetime_monitor_factory.h",
"app_restore_service.cc",
"app_restore_service.h",
"app_restore_service_factory.cc",
"app_restore_service_factory.h",
"browser_context_keyed_service_factories.cc",
"browser_context_keyed_service_factories.h",
"launcher.cc",
"launcher.h",
"metrics_names.h",
"saved_files_service.cc",
"saved_files_service.h",
"saved_files_service_factory.cc",
"saved_files_service_factory.h",
"switches.cc",
"switches.h",
]
sources += [
"app_lifetime_monitor.cc",
"app_lifetime_monitor.h",
"app_lifetime_monitor_factory.cc",
"app_lifetime_monitor_factory.h",
"app_restore_service.cc",
"app_restore_service.h",
"app_restore_service_factory.cc",
"app_restore_service_factory.h",
"browser_context_keyed_service_factories.cc",
"browser_context_keyed_service_factories.h",
"launcher.cc",
"launcher.h",
"metrics_names.h",
"saved_files_service.cc",
"saved_files_service.h",
"saved_files_service_factory.cc",
"saved_files_service_factory.h",
"switches.cc",
"switches.h",
]

configs += [ "//build/config/compiler:wexit_time_destructors" ]
configs += [ "//build/config/compiler:wexit_time_destructors" ]

deps = [
"//components/keyed_service/content",
"//content/public/browser",
"//content/public/common",
"//extensions/browser",
"//extensions/common",
"//extensions/common/api",
]
deps = [
"//components/keyed_service/content",
"//content/public/browser",
"//content/public/common",
"//extensions/browser",
"//extensions/common",
"//extensions/common/api",
]

if (is_chromeos) {
deps += [ "//components/user_manager" ]
}
if (is_chromeos) {
deps += [ "//components/user_manager" ]
}

# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1997,6 +1997,7 @@ split_static_library("browser") {
"//chrome/browser/extensions",
]
deps += [
"//apps",
"//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
"//chrome/common/extensions/api",
"//chrome/common/extensions/api:api_registration",
Expand Down Expand Up @@ -3706,7 +3707,6 @@ split_static_library("browser") {
]
deps += [
":theme_properties",
"//apps",
"//chrome/browser/policy:path_parser",
"//chrome/browser/profile_resetter:profile_reset_report_proto",
"//chrome/common/importer:interfaces",
Expand Down
7 changes: 6 additions & 1 deletion chrome/browser/devtools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

if (!is_android) {
import("//build/config/features.gni")
import("//chrome/common/features.gni")
Expand Down Expand Up @@ -73,7 +75,6 @@ static_library("devtools") {
"//chrome:strings",
"//chrome/app/theme:theme_resources",
"//chrome/common",
"//chrome/common/extensions/api",
"//net:http_server",
"//skia",
"//third_party/icu",
Expand Down Expand Up @@ -144,4 +145,8 @@ static_library("devtools") {
]
}
}

if (enable_extensions) {
deps += [ "//chrome/common/extensions/api" ]
}
}
5 changes: 3 additions & 2 deletions chrome/browser/media/router/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# found in the LICENSE file.
#

import("//extensions/features/features.gni")
import("//testing/test.gni")

static_library("router") {
Expand Down Expand Up @@ -63,7 +64,7 @@ static_library("router") {
"route_message_observer.h",
]

if (!is_android) {
if (enable_extensions) {
deps += [
"discovery",
"//extensions/browser",
Expand Down Expand Up @@ -102,7 +103,7 @@ static_library("test_support") {
"test_helper.h",
]

if (!is_android) {
if (enable_extensions) {
deps += [
"//chrome/common/media_router/mojo:media_router",
"//chrome/common/media_router/mojo:media_router_test_interfaces",
Expand Down
11 changes: 8 additions & 3 deletions chrome/browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,6 @@ split_static_library("ui") {
"zoom/chrome_zoom_level_prefs.h",
]
deps += [
"//apps",
"//apps/ui/views",
"//chrome/app/vector_icons",
"//chrome/browser/profile_resetter:profile_reset_report_proto",
"//chrome/common:features",
Expand All @@ -1098,11 +1096,18 @@ split_static_library("ui") {
"//components/web_modal",
"//components/zoom",
"//device/bluetooth",
"//extensions/common:mojo",
"//mash/public/interfaces",
"//services/device/public/interfaces",
"//ui/vector_icons",
]

if (enable_extensions) {
deps += [
"//apps",
"//apps/ui/views",
"//extensions/common:mojo",
]
}
}

if (enable_basic_printing || enable_print_preview) {
Expand Down
18 changes: 12 additions & 6 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ if (!is_android) {
"//content/test:test_support",
"//crypto:platform",
"//crypto:test_support",
"//extensions/features",
"//google_apis:test_support",
"//net",
"//net:net_resources",
Expand All @@ -398,6 +397,9 @@ if (!is_android) {
"//ui/resources:ui_test_pak",
"//ui/web_dialogs:test_support",
]
if (enable_extensions) {
deps += [ "//extensions/features" ]
}
}
}

Expand Down Expand Up @@ -2318,14 +2320,18 @@ test("browser_tests") {
}
} else { # !is_chromeos
sources -= [
"../browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc",
"../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc",
"../browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc",
"../browser/extensions/api/terminal/terminal_private_apitest.cc",
"../browser/invalidation/profile_invalidation_provider_factory_browsertest.cc",
"../browser/net/nss_context_chromeos_browsertest.cc",
"data/webui/certificate_viewer_ui_test-inl.h",
]
if (enable_extensions) {
sources -= [
"../browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc",
"../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc",
"../browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc",
"../browser/extensions/api/terminal/terminal_private_apitest.cc",
]
}
if (toolkit_views) {
sources -= [ "../browser/ui/views/select_file_dialog_extension_browsertest.cc" ]
}
Expand Down Expand Up @@ -2571,7 +2577,7 @@ test("browser_tests") {
}
if (use_brlapi) {
deps += [ "//build/linux/libbrlapi" ]
} else {
} else if (enable_extensions) {
sources -= [ "../browser/extensions/api/braille_display_private/braille_display_private_apitest.cc" ]
}
if (is_chrome_branded && safe_browsing_mode == 1 && !is_mac) {
Expand Down
4 changes: 4 additions & 0 deletions extensions/browser/api/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
# found in the LICENSE file.

import("//extensions/common/api/schema.gni")
import("//extensions/features/features.gni")
import("//tools/json_schema_compiler/json_schema_api.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("api") {
sources = [
"api_resource.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/activity_log/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("activity_log") {
sources = [
"web_request_constants.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/alarms/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("alarms") {
sources = [
"alarm_manager.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/app_current_window_internal/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("app_current_window_internal") {
sources = [
"app_current_window_internal_api.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/app_runtime/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("app_runtime") {
sources = [
"app_runtime_api.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/app_window/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("app_window") {
sources = [
"app_window_api.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/audio/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("audio") {
sources = [
"audio_api.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/bluetooth/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("bluetooth") {
sources = [
"bluetooth_api.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/bluetooth_low_energy/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("bluetooth_low_energy") {
sources = [
"bluetooth_api_advertisement.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/bluetooth_socket/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("bluetooth_socket") {
sources = [
"bluetooth_api_socket.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/cast_channel/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("cast_channel") {
sources = [
"cast_channel_api.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/clipboard/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("clipboard") {
sources = [
"clipboard_api.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/declarative/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("declarative") {
sources = [
"declarative_api.cc",
Expand Down
5 changes: 5 additions & 0 deletions extensions/browser/api/declarative_content/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/features/features.gni")

assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")

source_set("declarative_content") {
sources = [
"content_rules_registry.h",
Expand Down
Loading

0 comments on commit f7a620c

Please sign in to comment.