chore: move build files to build/ dir (#46368)
This commit is contained in:
parent
9c4720766d
commit
08da2b0b07
5 changed files with 5 additions and 5 deletions
235
build/electron_paks.gni
Normal file
235
build/electron_paks.gni
Normal file
|
@ -0,0 +1,235 @@
|
|||
import("//build/config/locales.gni")
|
||||
import("//electron/buildflags/buildflags.gni")
|
||||
import("//printing/buildflags/buildflags.gni")
|
||||
import("//tools/grit/repack.gni")
|
||||
import("//ui/base/ui_features.gni")
|
||||
|
||||
# See: //chrome/chrome_paks.gni
|
||||
template("electron_repack_percent") {
|
||||
percent = invoker.percent
|
||||
|
||||
repack(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"copy_data_to_bundle",
|
||||
"repack_whitelist",
|
||||
"visibility",
|
||||
])
|
||||
|
||||
# All sources should also have deps for completeness.
|
||||
sources = [
|
||||
"$root_gen_dir/components/components_resources_${percent}_percent.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_${percent}_percent.pak",
|
||||
"$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//components/resources",
|
||||
"//third_party/blink/public:scaled_resources_${percent}_percent",
|
||||
"//ui/resources",
|
||||
]
|
||||
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
|
||||
if (toolkit_views) {
|
||||
sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
|
||||
deps += [ "//ui/views/resources" ]
|
||||
}
|
||||
|
||||
output = "${invoker.output_dir}/chrome_${percent}_percent.pak"
|
||||
}
|
||||
}
|
||||
|
||||
template("electron_extra_paks") {
|
||||
repack(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"copy_data_to_bundle",
|
||||
"repack_whitelist",
|
||||
"visibility",
|
||||
])
|
||||
output = "${invoker.output_dir}/resources.pak"
|
||||
sources = [
|
||||
"$root_gen_dir/chrome/accessibility_resources.pak",
|
||||
"$root_gen_dir/chrome/browser_resources.pak",
|
||||
"$root_gen_dir/chrome/common_resources.pak",
|
||||
"$root_gen_dir/components/components_resources.pak",
|
||||
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
|
||||
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
||||
"$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
|
||||
"$root_gen_dir/content/content_resources.pak",
|
||||
"$root_gen_dir/content/gpu_resources.pak",
|
||||
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
|
||||
"$root_gen_dir/net/net_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
|
||||
"$target_gen_dir/electron_resources.pak",
|
||||
]
|
||||
deps = [
|
||||
"//chrome/browser:resources",
|
||||
"//chrome/browser/resources/accessibility:resources",
|
||||
"//chrome/common:resources",
|
||||
"//components/resources",
|
||||
"//content:content_resources",
|
||||
"//content/browser/resources/gpu:resources",
|
||||
"//content/browser/resources/media:resources",
|
||||
"//content/browser/resources/process:resources",
|
||||
"//content/browser/tracing:resources",
|
||||
"//content/browser/webrtc/resources",
|
||||
"//electron:resources",
|
||||
"//mojo/public/js:resources",
|
||||
"//net:net_resources",
|
||||
"//third_party/blink/public:devtools_inspector_resources",
|
||||
"//third_party/blink/public:resources",
|
||||
"//ui/webui/resources",
|
||||
]
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
if (defined(invoker.additional_paks)) {
|
||||
sources += invoker.additional_paks
|
||||
}
|
||||
|
||||
# New paks should be added here by default.
|
||||
sources += [
|
||||
"$root_gen_dir/content/browser/devtools/devtools_resources.pak",
|
||||
"$root_gen_dir/content/process_resources.pak",
|
||||
"$root_gen_dir/ui/webui/resources/webui_resources.pak",
|
||||
]
|
||||
deps += [ "//content/browser/devtools:devtools_resources" ]
|
||||
if (enable_pdf_viewer) {
|
||||
sources += [ "$root_gen_dir/chrome/pdf_resources.pak" ]
|
||||
deps += [ "//chrome/browser/resources/pdf:resources" ]
|
||||
}
|
||||
if (enable_print_preview) {
|
||||
sources += [ "$root_gen_dir/chrome/print_preview_resources.pak" ]
|
||||
deps += [ "//chrome/browser/resources/print_preview:resources" ]
|
||||
}
|
||||
if (enable_electron_extensions) {
|
||||
sources += [
|
||||
"$root_gen_dir/chrome/component_extension_resources.pak",
|
||||
"$root_gen_dir/extensions/extensions_renderer_resources.pak",
|
||||
"$root_gen_dir/extensions/extensions_resources.pak",
|
||||
]
|
||||
deps += [
|
||||
"//chrome/browser/resources:component_extension_resources",
|
||||
"//extensions:extensions_resources",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template("electron_paks") {
|
||||
electron_repack_percent("${target_name}_100_percent") {
|
||||
percent = "100"
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"copy_data_to_bundle",
|
||||
"deps",
|
||||
"output_dir",
|
||||
"repack_whitelist",
|
||||
"visibility",
|
||||
])
|
||||
}
|
||||
|
||||
if (enable_hidpi) {
|
||||
electron_repack_percent("${target_name}_200_percent") {
|
||||
percent = "200"
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"copy_data_to_bundle",
|
||||
"deps",
|
||||
"output_dir",
|
||||
"repack_whitelist",
|
||||
"visibility",
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
electron_extra_paks("${target_name}_extra") {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"copy_data_to_bundle",
|
||||
"deps",
|
||||
"output_dir",
|
||||
"repack_whitelist",
|
||||
"visibility",
|
||||
])
|
||||
if (defined(invoker.additional_extra_paks)) {
|
||||
additional_paks = invoker.additional_extra_paks
|
||||
}
|
||||
}
|
||||
|
||||
repack_locales("${target_name}_locales") {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"copy_data_to_bundle",
|
||||
"deps",
|
||||
"visibility",
|
||||
])
|
||||
if (defined(invoker.locale_whitelist)) {
|
||||
repack_whitelist = invoker.locale_whitelist
|
||||
} else if (defined(invoker.repack_whitelist)) {
|
||||
repack_whitelist = invoker.repack_whitelist
|
||||
}
|
||||
|
||||
source_patterns = [
|
||||
"${root_gen_dir}/chrome/branded_strings_",
|
||||
"${root_gen_dir}/chrome/locale_settings_",
|
||||
"${root_gen_dir}/chrome/platform_locale_settings_",
|
||||
"${root_gen_dir}/chrome/generated_resources_",
|
||||
"${root_gen_dir}/components/strings/components_locale_settings_",
|
||||
"${root_gen_dir}/components/strings/components_strings_",
|
||||
"${root_gen_dir}/device/bluetooth/strings/bluetooth_strings_",
|
||||
"${root_gen_dir}/extensions/strings/extensions_strings_",
|
||||
"${root_gen_dir}/services/strings/services_strings_",
|
||||
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_",
|
||||
"${root_gen_dir}/ui/strings/app_locale_settings_",
|
||||
"${root_gen_dir}/ui/strings/auto_image_annotation_strings_",
|
||||
"${root_gen_dir}/ui/strings/ax_strings_",
|
||||
"${root_gen_dir}/ui/strings/ui_strings_",
|
||||
]
|
||||
deps = [
|
||||
"//chrome/app:branded_strings",
|
||||
"//chrome/app:generated_resources",
|
||||
"//chrome/app/resources:locale_settings",
|
||||
"//chrome/app/resources:platform_locale_settings",
|
||||
"//components/strings:components_locale_settings",
|
||||
"//components/strings:components_strings",
|
||||
"//device/bluetooth/strings",
|
||||
"//extensions/strings",
|
||||
"//services/strings",
|
||||
"//third_party/blink/public/strings",
|
||||
"//ui/strings:app_locale_settings",
|
||||
"//ui/strings:auto_image_annotation_strings",
|
||||
"//ui/strings:ax_strings",
|
||||
"//ui/strings:ui_strings",
|
||||
]
|
||||
|
||||
input_locales = platform_pak_locales
|
||||
output_dir = "${invoker.output_dir}/locales"
|
||||
|
||||
if (is_mac) {
|
||||
output_locales = locales_as_apple_outputs
|
||||
} else {
|
||||
output_locales = platform_pak_locales
|
||||
}
|
||||
}
|
||||
|
||||
group(target_name) {
|
||||
forward_variables_from(invoker, [ "deps" ])
|
||||
public_deps = [
|
||||
":${target_name}_100_percent",
|
||||
":${target_name}_extra",
|
||||
":${target_name}_locales",
|
||||
]
|
||||
if (enable_hidpi) {
|
||||
public_deps += [ ":${target_name}_200_percent" ]
|
||||
}
|
||||
if (defined(invoker.public_deps)) {
|
||||
public_deps += invoker.public_deps
|
||||
}
|
||||
}
|
||||
}
|
18
build/electron_resources.grd
Normal file
18
build/electron_resources.grd
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The Resource ids for messages start from 31750 and for includes
|
||||
it starts from 31950, make sure they don't overlap when the limit
|
||||
exceeds in //tools/gritsettings/resource_ids -->
|
||||
<grit latest_public_release="0" current_release="1"
|
||||
source_lang_id="en">
|
||||
<outputs>
|
||||
<output filename="grit/electron_resources.h" type="rc_header">
|
||||
<emit emit_type='prepend'></emit>
|
||||
</output>
|
||||
<output filename="electron_resources.pak" type="data_package" />
|
||||
</outputs>
|
||||
<release seq="1" allow_pseudo="false">
|
||||
<includes>
|
||||
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}/shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
|
||||
</includes>
|
||||
</release>
|
||||
</grit>
|
71
build/js2c_toolchain.gni
Normal file
71
build/js2c_toolchain.gni
Normal file
|
@ -0,0 +1,71 @@
|
|||
# Copyright (c) 2023 Microsoft, GmbH
|
||||
# Use of this source code is governed by the MIT license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
declare_args() {
|
||||
electron_js2c_toolchain = ""
|
||||
}
|
||||
|
||||
if (electron_js2c_toolchain == "") {
|
||||
if (current_os == host_os && current_cpu == host_cpu) {
|
||||
# This is not a cross-compile, so build the snapshot with the current
|
||||
# toolchain.
|
||||
electron_js2c_toolchain = current_toolchain
|
||||
} else if (current_os == host_os && current_cpu == "x86" &&
|
||||
host_cpu == "x64") {
|
||||
# This is an x64 -> x86 cross-compile, but x64 hosts can usually run x86
|
||||
# binaries built for the same OS, so build the snapshot with the current
|
||||
# toolchain here, too.
|
||||
electron_js2c_toolchain = current_toolchain
|
||||
} else if (current_os == host_os && host_cpu == "arm64" &&
|
||||
current_cpu == "arm") {
|
||||
# Trying to compile 32-bit arm on arm64. Good luck!
|
||||
electron_js2c_toolchain = current_toolchain
|
||||
} else if (host_cpu == current_cpu) {
|
||||
# Cross-build from same ISA on one OS to another. For example:
|
||||
# * targeting win/x64 on a linux/x64 host
|
||||
# * targeting win/arm64 on a mac/arm64 host
|
||||
electron_js2c_toolchain = host_toolchain
|
||||
} else if (host_cpu == "arm64" && current_cpu == "x64") {
|
||||
# Cross-build from arm64 to intel (likely on an Apple Silicon mac).
|
||||
electron_js2c_toolchain =
|
||||
"//build/toolchain/${host_os}:clang_arm64_v8_$current_cpu"
|
||||
} else if (host_cpu == "x64") {
|
||||
# This is a cross-compile from an x64 host to either a non-Intel target
|
||||
# cpu or to 32-bit x86 on a different target OS.
|
||||
|
||||
assert(current_cpu != "x64", "handled by host_cpu == current_cpu branch")
|
||||
if (current_cpu == "x86") {
|
||||
_cpus = current_cpu
|
||||
} else if (current_cpu == "arm64") {
|
||||
if (is_win) {
|
||||
# set _cpus to blank for Windows ARM64 so host_toolchain could be
|
||||
# selected as snapshot toolchain later.
|
||||
_cpus = ""
|
||||
} else {
|
||||
_cpus = "x64_v8_${current_cpu}"
|
||||
}
|
||||
} else if (current_cpu == "arm") {
|
||||
_cpus = "x86_v8_${current_cpu}"
|
||||
} else {
|
||||
# This branch should not be reached; leave _cpus blank so the assert
|
||||
# below will fail.
|
||||
_cpus = ""
|
||||
}
|
||||
|
||||
if (_cpus != "") {
|
||||
electron_js2c_toolchain = "//build/toolchain/${host_os}:clang_${_cpus}"
|
||||
} else if (is_win && current_cpu == "arm64") {
|
||||
# cross compile Windows arm64 with host toolchain.
|
||||
electron_js2c_toolchain = host_toolchain
|
||||
}
|
||||
} else if (host_cpu == "arm64" && current_cpu == "arm64" &&
|
||||
host_os == "mac") {
|
||||
# cross compile iOS arm64 with host_toolchain
|
||||
electron_js2c_toolchain = host_toolchain
|
||||
}
|
||||
}
|
||||
|
||||
assert(electron_js2c_toolchain != "",
|
||||
"Do not know how to build js2c for $current_toolchain " +
|
||||
"on $host_os $host_cpu")
|
Loading…
Add table
Add a link
Reference in a new issue