Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Unified Diff: third_party/yasm/BUILD.gn

Issue 2885213002: Optimize yasm even in debug builds (Closed)
Patch Set: Use variables to avoid replicating logic Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/win/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/yasm/BUILD.gn
diff --git a/third_party/yasm/BUILD.gn b/third_party/yasm/BUILD.gn
index adcb833184e15a75c21fb4bee53f149db550bf0b..2dba5dbea152aed79b94d4553728369e2f87785f 100644
--- a/third_party/yasm/BUILD.gn
+++ b/third_party/yasm/BUILD.gn
@@ -29,6 +29,31 @@
import("//build/config/compiler/compiler.gni")
+configs_to_delete = []
+configs_to_add = []
+if (is_debug) {
+ configs_to_delete += [
+ # Build with full optimizations even on debug configurations, because some
+ # yasm build steps (highbd_sad4d_sse2.asm) can take ~33 seconds or more in
+ # debug component builds on Windows. Enabling compiler optimizations saves
+ # ~5 seconds.
+ "//build/config/compiler:default_optimization",
+
+ # Don't define _DEBUG. Modest savings, but good for consistency.
+ "//build/config:debug",
+ ]
+ configs_to_add += [
+ "//build/config:release",
+ "//build/config/compiler:optimize_max",
+ ]
+ if (is_win) {
+ # This switches to using the release CRT. On debug component builds of
+ # highbd_sad4d_sse2.asm on Windows this saves about 15 s.
+ configs_to_delete += [ "//build/config/win:default_crt" ]
+ configs_to_add += [ "//build/config/win:release_crt" ]
+ }
+}
+
if (current_toolchain == host_toolchain) {
# Various files referenced by multiple targets.
yasm_gen_include_dir = "$target_gen_dir/include"
@@ -94,6 +119,10 @@ if (current_toolchain == host_toolchain) {
"//build/config/compiler:no_chromium_code",
]
+ # Must be compatible with yasm_utils/yasm
+ configs -= configs_to_delete
+ configs += configs_to_add
+
deps = [
":yasm_utils",
"//build/config/sanitizers:deps",
@@ -116,6 +145,10 @@ if (current_toolchain == host_toolchain) {
":yasm_config",
"//build/config/compiler:no_chromium_code",
]
+
+ # Must be compatible with yasm
+ configs -= configs_to_delete
+ configs += configs_to_add
}
executable("genstring") {
@@ -308,6 +341,9 @@ if (current_toolchain == host_toolchain) {
if (is_official_build && full_wpo_on_official) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_no_wpo" ]
+ } else {
+ configs -= configs_to_delete
+ configs += configs_to_add
}
# Yasm generates a bunch of .c files which its source file #include.
« no previous file with comments | « build/config/win/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698