OLD | NEW |
1 # Copyright 2014 The LibYuv Project Authors. All rights reserved. | 1 # Copyright 2014 The LibYuv Project Authors. All rights reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import("//build/config/arm.gni") | 9 import("//build/config/arm.gni") |
| 10 import("//build/config/mips.gni") |
10 import("//build/config/sanitizers/sanitizers.gni") | 11 import("//build/config/sanitizers/sanitizers.gni") |
11 | 12 |
12 config("libyuv_config") { | 13 config("libyuv_config") { |
13 include_dirs = [ | 14 include_dirs = [ |
14 ".", | 15 ".", |
15 "include", | 16 "include", |
16 ] | 17 ] |
17 } | 18 } |
18 | 19 |
19 use_neon = current_cpu == "arm64" || (current_cpu == "arm" && (arm_use_neon || a
rm_optionally_use_neon)) | 20 use_neon = current_cpu == "arm64" || (current_cpu == "arm" && (arm_use_neon || a
rm_optionally_use_neon)) |
| 21 use_msa = (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa |
20 | 22 |
21 static_library("libyuv") { | 23 static_library("libyuv") { |
22 sources = [ | 24 sources = [ |
23 # Headers | 25 # Headers |
24 "include/libyuv.h", | 26 "include/libyuv.h", |
25 "include/libyuv/basic_types.h", | 27 "include/libyuv/basic_types.h", |
26 "include/libyuv/compare.h", | 28 "include/libyuv/compare.h", |
27 "include/libyuv/convert.h", | 29 "include/libyuv/convert.h", |
28 "include/libyuv/convert_argb.h", | 30 "include/libyuv/convert_argb.h", |
29 "include/libyuv/convert_from.h", | 31 "include/libyuv/convert_from.h", |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 88 |
87 if (!is_ios) { | 89 if (!is_ios) { |
88 defines += [ "HAVE_JPEG" ] | 90 defines += [ "HAVE_JPEG" ] |
89 deps += [ "//third_party:jpeg" ] | 91 deps += [ "//third_party:jpeg" ] |
90 } | 92 } |
91 | 93 |
92 if (use_neon) { | 94 if (use_neon) { |
93 deps += [ ":libyuv_neon" ] | 95 deps += [ ":libyuv_neon" ] |
94 } | 96 } |
95 | 97 |
| 98 if (use_msa) { |
| 99 deps += [ ":libyuv_msa" ] |
| 100 } |
| 101 |
96 if (is_nacl) { | 102 if (is_nacl) { |
97 # Always enable optimization under NaCl to workaround crbug.com/538243 . | 103 # Always enable optimization under NaCl to workaround crbug.com/538243 . |
98 configs -= [ "//build/config/compiler:default_optimization" ] | 104 configs -= [ "//build/config/compiler:default_optimization" ] |
99 configs += [ "//build/config/compiler:optimize_max" ] | 105 configs += [ "//build/config/compiler:optimize_max" ] |
100 } | 106 } |
101 } | 107 } |
102 | 108 |
103 if (use_neon) { | 109 if (use_neon) { |
104 static_library("libyuv_neon") { | 110 static_library("libyuv_neon") { |
105 sources = [ | 111 sources = [ |
106 # ARM Source Files | 112 # ARM Source Files |
107 "source/compare_neon.cc", | 113 "source/compare_neon.cc", |
108 "source/compare_neon64.cc", | 114 "source/compare_neon64.cc", |
109 "source/rotate_neon.cc", | 115 "source/rotate_neon.cc", |
110 "source/rotate_neon64.cc", | 116 "source/rotate_neon64.cc", |
111 "source/row_neon.cc", | 117 "source/row_neon.cc", |
112 "source/row_neon64.cc", | 118 "source/row_neon64.cc", |
113 "source/scale_neon.cc", | 119 "source/scale_neon.cc", |
114 "source/scale_neon64.cc", | 120 "source/scale_neon64.cc", |
115 ] | 121 ] |
116 | 122 |
117 public_configs = [ ":libyuv_config" ] | 123 public_configs = [ ":libyuv_config" ] |
118 | 124 |
119 if (current_cpu != "arm64") { | 125 if (current_cpu != "arm64") { |
120 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] | 126 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
121 cflags = [ "-mfpu=neon" ] | 127 cflags = [ "-mfpu=neon" ] |
122 } | 128 } |
123 } | 129 } |
124 } | 130 } |
| 131 |
| 132 if (use_msa) { |
| 133 static_library("libyuv_msa") { |
| 134 sources = [ |
| 135 # MSA Source Files |
| 136 "source/row_msa.cc", |
| 137 ] |
| 138 |
| 139 public_configs = [ ":libyuv_config" ] |
| 140 } |
| 141 } |
OLD | NEW |