Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/config/chromium_android-arm-lightweight.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"docker_service": "linux",
"platforms": [
"chromium_android-arm"
],
"gn_args": [
{
"enable_lightweight" : true,
"target_os": "android",
"target_cpu": "arm"
}
],
"targets": [
"content_shell",
"system_webview_apk",
"system_webview_shell_apk"
],
"includes": [
{
"name": "arm",
"platform": "chromium_android-arm"
}
]
}
22 changes: 22 additions & 0 deletions .github/config/chromium_linux-lightweight.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"docker_service": "linux",
"platforms": [
"chromium_linux-x64x11"
],
"gn_args": [
{
"enable_lightweight" : true
}
],
"targets": [
"chromedriver",
"content_shell",
"dump_syms"
],
"includes": [
{
"name": "x64",
"platform": "chromium_linux-x64x11"
}
]
}
44 changes: 25 additions & 19 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# file to your new one or GN won't know about it.

import("//build/config/cast.gni")
import("//build/config/chrome_exclude.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/cronet/config.gni")
import("//build/config/dcheck_always_on.gni")
Expand Down Expand Up @@ -149,7 +150,7 @@ group("gn_all") {
}

if (!is_ios && !is_android && !is_castos) {
if (!is_fuchsia) {
if (!exclude_chrome_build) {
deps += [
"//chrome",
"//chrome/browser/ui/actions:dump_actions",
Expand All @@ -171,15 +172,15 @@ group("gn_all") {
]
}

if (!is_castos && !is_fuchsia) {
if (!exclude_chrome_build) {
deps += [ "//chrome/installer" ]
}

if (!is_fuchsia && enable_updater) {
if (!exclude_chrome_build && enable_updater) {
deps += [ "//chrome/updater" ]
}

if (enable_enterprise_companion) {
if (enable_enterprise_companion && !exclude_chrome_build) {
deps += [ "//chrome/enterprise_companion" ]
}

Expand All @@ -191,7 +192,7 @@ group("gn_all") {
}

if (!is_ios && !is_castos) {
if (!is_fuchsia) {
if (!exclude_chrome_build) {
deps += [ "//chrome/test:unit_tests" ]
}
deps += [ "//ui/accessibility:accessibility_unittests" ]
Expand Down Expand Up @@ -261,7 +262,7 @@ group("gn_all") {
"//third_party/catapult/telemetry:bitmaptools($host_toolchain)",
]
if (!is_android) {
if (!is_castos && !is_fuchsia) {
if (!exclude_chrome_build) {
deps += [ "//chrome/test:telemetry_perf_unittests" ]
}
} else {
Expand Down Expand Up @@ -331,7 +332,7 @@ group("gn_all") {
]
}

if (enterprise_watermark) {
if (enterprise_watermark && !exclude_chrome_build) {
deps += [ "//chrome/browser/enterprise/watermark:watermark_app" ]
}

Expand Down Expand Up @@ -497,7 +498,7 @@ group("gn_all") {
deps += [ "//testing:empty_main" ]
}

if (!is_castos) {
if (!exclude_chrome_build) {
deps += [ "//chrome:xdg_mime" ]
}

Expand Down Expand Up @@ -555,7 +556,7 @@ group("gn_all") {
]
}

if (!is_android && !is_castos && !is_ios && !is_fuchsia) {
if (!is_android && !is_ios && !exclude_chrome_build) {
deps += [
"//chrome/test:load_library_perf_tests",
"//chrome/test:sync_performance_tests",
Expand Down Expand Up @@ -626,7 +627,7 @@ group("gn_all") {
"//ui/snapshot:snapshot_unittests",
]

if (!is_castos) {
if (!exclude_chrome_build) {
deps += [ "//chrome/test:chrome_app_unittests" ]
}

Expand Down Expand Up @@ -757,8 +758,6 @@ group("gn_all") {
# TODO(https://crbug.com/1329673): Figure out if any of these should be in
# gn_all and figure out how cross-platform they are.
deps += [
"//chrome/installer/util:strings",
"//chrome/tools/convert_dict",
"//components/constrained_window:unit_tests",
"//components/metrics:serialization",
"//components/sessions:unit_tests",
Expand All @@ -778,8 +777,15 @@ group("gn_all") {
"//ui/shell_dialogs:shell_dialogs_unittests",
]

if (!exclude_chrome_build) {
deps += [
"//chrome/installer/util:strings",
"//chrome/tools/convert_dict",
]
}

if (target_cpu == "x86" || target_cpu == "x64") {
if (!is_android) {
if (!is_android && !exclude_chrome_build) {
deps += [ "//chrome/test:load_library_perf_tests" ]
}
deps += [ "//third_party/libjpeg_turbo:simd_asm" ]
Expand Down Expand Up @@ -817,7 +823,7 @@ group("gn_all") {
]
}

if (enable_vr) {
if (enable_vr && !exclude_chrome_build) {
deps += [
"//chrome/browser/vr:vr_common_perftests",
"//chrome/browser/vr:vr_common_unittests",
Expand Down Expand Up @@ -1136,7 +1142,7 @@ if (use_blink && !is_cronet_build) {
"//third_party/blink/public:all_blink",
]

if (!is_chromeos && !is_ios && !is_fuchsia && !is_android && !is_castos) {
if (!is_chromeos && !is_ios && !is_android && !exclude_chrome_build) {
deps += [
":chrome_wpt_tests",
":headless_shell_wpt",
Expand Down Expand Up @@ -1190,7 +1196,7 @@ if (use_blink && !is_cronet_build) {
]
}

if (!is_chromeos && !is_ios && !is_fuchsia && !is_android && !is_castos) {
if (!is_chromeos && !is_ios && !is_android && !exclude_chrome_build) {
# https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/run_web_platform_tests.md
script_test("chrome_wpt_tests") {
script = "//third_party/blink/tools/run_wpt_tests.py"
Expand Down Expand Up @@ -1746,14 +1752,14 @@ group("chromium_builder_perf") {
"//tools/perf/chrome_telemetry_build:telemetry_chrome_test",
]

if (!is_fuchsia) {
if (!exclude_chrome_build) {
data_deps += [
"//chrome/test:load_library_perf_tests",
"//chrome/test:performance_test_suite",
]
}

if (!is_chromeos && !is_fuchsia) {
if (!is_chromeos && !exclude_chrome_build) {
data_deps += [ "//chrome/test:performance_browser_tests" ]
}

Expand Down Expand Up @@ -1791,7 +1797,7 @@ if (!is_ios && !is_android && !is_castos && !is_cronet_build) {
"//third_party/blink/public/mojom:mojom_modules_js",
"//v8:d8",
]
if (!is_fuchsia) {
if (!exclude_chrome_build) {
deps += [ "//chrome:chrome" ]
}
if (!is_win) {
Expand Down
9 changes: 9 additions & 0 deletions build/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import("//build/config/cast.gni")
import("//build/config/chrome_build.gni")
import("//build/config/chromeos/args.gni")
import("//build/config/features.gni")
import("//build/config/lightweight.gni")
import("//build/util/process_version.gni")
import("//build_overrides/build.gni")

Expand Down Expand Up @@ -123,6 +124,14 @@ buildflag_header("android_buildflags") {
flags = [ "IS_DESKTOP_ANDROID=$is_desktop_android" ]
}

# Build flags for lightweight builds.
buildflag_header("lightweight_buildflags") {
header = "lightweight_buildflags.h"
flags = [
"DISABLE_XR=$disable_xr",
]
}

if (build_with_chromium) {
group("gold_common_pytype") {
testonly = true
Expand Down
33 changes: 33 additions & 0 deletions build/config/chrome_exclude.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2025 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/cast.gni")
import("//build/config/lightweight.gni")

declare_args() {
# Controls whether to exclude //chrome directory from the build graph.
# This prevents unnecessary GN failures caused by //chrome dependencies when
# building only specific Chromium components without the Chrome browser.
#
# When true:
# - //chrome targets are excluded from the build
# - Prevents GN failures from unwanted //chrome dependencies
#
# Supported platforms:
# - Fuchsia, CastOS: Always true
# - Linux: Optional
#
# TODO: Consider adding is_cast_android support.
exclude_chrome_build =
is_fuchsia || is_castos || (enable_lightweight && !is_android)
}

if (exclude_chrome_build && !(is_fuchsia || is_castos || is_linux)) {
print("WARNING: exclude_chrome_build=true is only supported on Fuchsia, " +
"CastOS, and Linux platforms.")
}

# For Fuchsia and CastOS, exclude_chrome_build must be true.
assert(!(is_fuchsia || is_castos) || exclude_chrome_build,
"exclude_chrome_build must be true for Fuchsia and CastOS.")
17 changes: 17 additions & 0 deletions build/config/lightweight.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Lightweight build configuration. Only Linux based build is considered.
declare_args() {
enable_lightweight = false
}

declare_args() {
# Disable Bluetooth support.
# Serial which depends on Bluetooth is also excluded from the build.
disable_bluetooth = enable_lightweight

# Disable XR support.
disable_xr = enable_lightweight
}
Loading
Loading