OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/arm.gni") | 5 import("//build/config/arm.gni") |
6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
8 import("//third_party/libvpx/libvpx_srcs.gni") | 8 import("//third_party/libvpx/libvpx_srcs.gni") |
9 import("//third_party/yasm/yasm_assemble.gni") | 9 import("//third_party/yasm/yasm_assemble.gni") |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 if (is_nacl) { | 32 if (is_nacl) { |
33 platform_include_dir = "//third_party/libvpx/source/config/nacl" | 33 platform_include_dir = "//third_party/libvpx/source/config/nacl" |
34 } else { | 34 } else { |
35 # The mac configurations are currently a relic. They were useful when | 35 # The mac configurations are currently a relic. They were useful when |
36 # x86inc.asm did not work for MACH_O but now the build is identical to the | 36 # x86inc.asm did not work for MACH_O but now the build is identical to the |
37 # linux config. iOS for arm on the other hand needs an apple-specific twist in | 37 # linux config. iOS for arm on the other hand needs an apple-specific twist in |
38 # vpx_config.asm | 38 # vpx_config.asm |
39 if (is_ios && current_cpu == "arm") { | 39 if (is_ios && current_cpu == "arm") { |
40 os_category = current_os | 40 os_category = current_os |
41 } else if (is_posix) { # Should cover linux, mac, and the ios simulator. | 41 } else if (is_posix) { # Should cover linux, mac, and the ios simulator. |
42 os_category = "linux" | 42 os_category = "linux" |
43 } else { # This should only match windows. | 43 } else { # This should only match windows. |
44 os_category = current_os | 44 os_category = current_os |
45 } | 45 } |
46 platform_include_dir = | 46 platform_include_dir = |
47 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full" | 47 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full" |
48 } | 48 } |
49 | 49 |
50 config("libvpx_config") { | 50 config("libvpx_config") { |
51 include_dirs = [ | 51 include_dirs = [ |
52 "//third_party/libvpx/source/config", | 52 "//third_party/libvpx/source/config", |
53 platform_include_dir, | 53 platform_include_dir, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 sources = libvpx_srcs_x86_64_sse4_1 | 173 sources = libvpx_srcs_x86_64_sse4_1 |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 source_set("libvpx_intrinsics_avx") { | 177 source_set("libvpx_intrinsics_avx") { |
178 configs += [ ":libvpx_config" ] | 178 configs += [ ":libvpx_config" ] |
179 configs -= [ "//build/config/compiler:chromium_code" ] | 179 configs -= [ "//build/config/compiler:chromium_code" ] |
180 configs += [ "//build/config/compiler:no_chromium_code" ] | 180 configs += [ "//build/config/compiler:no_chromium_code" ] |
181 configs += [ ":libvpx_warnings" ] | 181 configs += [ ":libvpx_warnings" ] |
182 if (is_win) { | 182 if (is_win) { |
183 cflags = [ "/arch:AVX" ] | 183 if (is_clang) { |
| 184 cflags = [ "/arch:AVX" ] |
| 185 } else { |
| 186 # /arch:AVX leads to ODR violations in CRT functions that are inline but |
| 187 # not inlined. crbug.com/666707 |
| 188 cflags = [ "/wd4752" ] |
| 189 } |
184 } else { | 190 } else { |
185 cflags = [ "-mavx" ] | 191 cflags = [ "-mavx" ] |
186 } | 192 } |
187 if (current_cpu == "x86") { | 193 if (current_cpu == "x86") { |
188 sources = libvpx_srcs_x86_avx | 194 sources = libvpx_srcs_x86_avx |
189 } else if (current_cpu == "x64") { | 195 } else if (current_cpu == "x64") { |
190 sources = libvpx_srcs_x86_64_avx | 196 sources = libvpx_srcs_x86_64_avx |
191 } | 197 } |
192 } | 198 } |
193 | 199 |
194 source_set("libvpx_intrinsics_avx2") { | 200 source_set("libvpx_intrinsics_avx2") { |
195 configs += [ ":libvpx_config" ] | 201 configs += [ ":libvpx_config" ] |
196 configs -= [ "//build/config/compiler:chromium_code" ] | 202 configs -= [ "//build/config/compiler:chromium_code" ] |
197 configs += [ "//build/config/compiler:no_chromium_code" ] | 203 configs += [ "//build/config/compiler:no_chromium_code" ] |
198 configs += [ ":libvpx_warnings" ] | 204 configs += [ ":libvpx_warnings" ] |
199 if (is_win) { | 205 if (is_win) { |
200 cflags = [ "/arch:AVX2" ] | 206 if (is_clang) { |
| 207 cflags = [ "/arch:AVX2" ] |
| 208 } else { |
| 209 # /arch:AVX leads to ODR violations in CRT functions that are inline but |
| 210 # not inlined. crbug.com/666707 |
| 211 cflags = [ "/wd4752" ] |
| 212 } |
201 } else { | 213 } else { |
202 cflags = [ "-mavx2" ] | 214 cflags = [ "-mavx2" ] |
203 } | 215 } |
204 if (current_cpu == "x86") { | 216 if (current_cpu == "x86") { |
205 sources = libvpx_srcs_x86_avx2 | 217 sources = libvpx_srcs_x86_avx2 |
206 } else if (current_cpu == "x64") { | 218 } else if (current_cpu == "x64") { |
207 sources = libvpx_srcs_x86_64_avx2 | 219 sources = libvpx_srcs_x86_64_avx2 |
208 } | 220 } |
209 } | 221 } |
210 } | 222 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 339 } |
328 if (is_android) { | 340 if (is_android) { |
329 deps += [ "//third_party/android_tools:cpu_features" ] | 341 deps += [ "//third_party/android_tools:cpu_features" ] |
330 } | 342 } |
331 if (current_cpu == "arm" && arm_assembly_sources != []) { | 343 if (current_cpu == "arm" && arm_assembly_sources != []) { |
332 deps += [ ":libvpx_assembly_arm" ] | 344 deps += [ ":libvpx_assembly_arm" ] |
333 } | 345 } |
334 | 346 |
335 public_configs = [ ":libvpx_external_config" ] | 347 public_configs = [ ":libvpx_external_config" ] |
336 } | 348 } |
OLD | NEW |