libchromiumcontent/patches/001-build_gn.patch

86 строки
3.6 KiB
Diff

diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index de3f35f124aa..a52003f1b5e1 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -123,6 +123,8 @@ if (current_os == "") {
# even if the value is overridden, which is wasteful. See first bullet.
declare_args() {
+ is_electron_build = false
+
# Set to enable the official build level of optimization. This has nothing
# to do with branding, but enables an additional level of optimization above
# release (!is_debug). This might be better expressed as a tri-state
@@ -520,6 +522,7 @@ default_compiler_configs = [
"//build/config/compiler:no_rtti",
"//build/config/compiler:runtime_library",
"//build/config/sanitizers:default_sanitizer_flags",
+ "//chromiumcontent/config:mas_build",
]
if (is_win) {
default_compiler_configs += [
@@ -642,6 +645,7 @@ template("component") {
_component_mode = "shared_library"
} else if (defined(invoker.static_component_type)) {
assert(invoker.static_component_type == "static_library" ||
+ (is_electron_build && invoker.static_component_type == "shared_library") ||
invoker.static_component_type == "source_set")
_component_mode = invoker.static_component_type
} else if (is_android || !defined(invoker.sources)) {
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index b5d6d8fdb443..5b2e5ce93ca0 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -520,8 +520,11 @@ config("compiler") {
}
}
- cflags += [ "-fwhole-program-vtables" ]
- ldflags += [ "-fwhole-program-vtables" ]
+ # -fwhole-program-vtables doesn't work well in Electron right now, as it's
+ # not a single binary and the optimizations break interfaces used across
+ # binary boundaries.
+ # cflags += [ "-fwhole-program-vtables" ]
+ # ldflags += [ "-fwhole-program-vtables" ]
# Work-around for http://openradar.appspot.com/20356002
if (is_mac) {
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index 5e1f7fcc4d83..15723e6b7184 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -276,7 +276,7 @@ config("common_linker_setup") {
# See https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx for a reference of
# what each value does.
config("default_crt") {
- if (is_component_build) {
+ if (is_component_build || is_electron_build) {
# Component mode: dynamic CRT. Since the library is shared, it requires
# exceptions or will give errors about things not matching, so keep
# exceptions on.
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn
index 6c86a6454256..2bc8c31396af 100644
--- a/third_party/WebKit/Source/platform/BUILD.gn
+++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -160,6 +160,7 @@ action("instrumentation_probes") {
}
executable("character_data_generator") {
+ configs += [ "//chromiumcontent/config:build_time_executable" ]
sources = [
"text/CharacterPropertyDataGenerator.cpp",
"text/CharacterPropertyDataGenerator.h",
diff --git a/third_party/widevine/cdm/BUILD.gn b/third_party/widevine/cdm/BUILD.gn
index 9e744b9940e2..09208f2e98fa 100644
--- a/third_party/widevine/cdm/BUILD.gn
+++ b/third_party/widevine/cdm/BUILD.gn
@@ -110,7 +110,7 @@ if (widevine_cdm_binary_files != []) {
"//build/config:exe_and_shlib_deps",
]
- if (is_mac) {
+ if (is_mac && !is_electron_build) {
ldflags = [
# Not to strip important symbols by -Wl,-dead_strip.
"-Wl,-exported_symbol,_PPP_GetInterface",