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

Unified Diff: skia/BUILD.gn

Issue 1160253011: gn: Don't build sse3 code in skia with -msse4.1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/BUILD.gn
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index 3b4b0a61dc40f55b3e5d9a7e306985820b8ab649..45916bf31ee1ea562a8f537747cce2fc7ceababc 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -557,21 +557,54 @@ component("skia") {
}
# Separated out so it can be compiled with different flags for SSE.
-# TODO(GYP): This is wrong, it needs one target per arch http://crbug.com/496512
+if (current_cpu == "x86" || current_cpu == "x64") {
+ source_set("skia_opts_sse3") {
+ sources = gypi_skia_opts.ssse3_sources
+ if (!is_win || is_clang) {
+ cflags = [ "-mssse3" ]
+ }
+ if (is_win) {
+ defines = [ "SK_CPU_SSE_LEVEL=31" ]
+ }
+ visibility = [ ":skia_opts" ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [
+ ":skia_config",
+ ":skia_library_config",
+ "//build/config/compiler:no_chromium_code",
+ ]
+ }
+ source_set("skia_opts_sse4") {
+ sources = gypi_skia_opts.sse41_sources
+ if (!is_win || is_clang) {
+ cflags = [ "-msse4.1" ]
+ }
+ if (is_win) {
+ defines = [ "SK_CPU_SSE_LEVEL=41" ]
+ }
+ visibility = [ ":skia_opts" ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [
+ ":skia_config",
+ ":skia_library_config",
+ "//build/config/compiler:no_chromium_code",
+ ]
+ }
+}
source_set("skia_opts") {
cflags = []
defines = []
- if (current_cpu == "x86" || current_cpu == "x64") {
- sources = gypi_skia_opts.sse2_sources + gypi_skia_opts.ssse3_sources +
- gypi_skia_opts.sse41_sources
+ deps = [
+ "//base",
+ ]
- if (!is_win || is_clang) {
- cflags += [ "-msse4.1" ]
- }
- if (is_win) {
- defines += [ "SK_CPU_SSE_LEVEL=41" ]
- }
+ if (current_cpu == "x86" || current_cpu == "x64") {
+ sources = gypi_skia_opts.sse2_sources
+ deps += [
+ ":skia_opts_sse3",
+ ":skia_opts_sse4",
+ ]
} else if (current_cpu == "arm") {
# The assembly uses the frame pointer register (r7 in Thumb/r11 in
# ARM), the compiler doesn't like that.
@@ -616,10 +649,6 @@ source_set("skia_opts") {
"//build/config/compiler:no_chromium_code",
]
- deps = [
- "//base",
- ]
-
visibility = [ ":skia" ]
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698