From 5bf72ee3fc17b345d88e5a75b369f9b52517ec44 Mon Sep 17 00:00:00 2001 From: Alexis Hetu Date: Thu, 10 Aug 2017 13:52:42 -0400 Subject: [PATCH] Always produce an optimized library on Chromium MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The SwiftShader library, when used to render Layout Tests in Debug, causes too many timeouts. For that reason, we need the Debug version of the library have better overall performance. In Debug, the "default_optimization" defaults to "no_optimization". See: https://cs.chromium.org/chromium/src/build/config/compiler/BUILD.gn?l=1698 In Release, "default_optimization" defaults to "optimize", so in order to at least use the same optimization flags in both case, we replace "default_optimization" by "optimize" in Debug. The Win 7 (dbg) bot ran successfully with this change (the telemetry_tests were failing when building the full Release version of the SwiftShader library with the Debug version of Chromium). Change-Id: I3529160b539319e26f9898d2588536d378c3ee01 Reviewed-on: https://swiftshader-review.googlesource.com/11469 Reviewed-by: Alexis Hétu Reviewed-by: Nicolas Capens Tested-by: Alexis Hétu --- src/swiftshader.gni | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/swiftshader.gni b/src/swiftshader.gni index 5bb787574..9148762c6 100644 --- a/src/swiftshader.gni +++ b/src/swiftshader.gni @@ -12,6 +12,12 @@ if (is_win) { configs_to_delete += [ "//build/config/win:unicode" ] } +if (is_debug) { + # always build optimized version of SwiftShader for performance reasons + configs_to_delete += [ "//build/config/compiler:default_optimization" ] + configs_to_add += [ "//build/config/compiler:optimize" ] +} + configs_to_delete += [ "//build/config/compiler:chromium_code" ] configs_to_add += [ "//build/config/compiler:no_chromium_code", -- 2.11.0