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
3 # found in the LICENSE file.
5 # Do not use the targets in this file unless you need a certain libjpeg
6 # implementation. Use the meta target //third_party:jpeg instead.
8 if (cpu_arch == "arm") {
9 import("//build/config/arm.gni")
12 if (cpu_arch == "x86" || cpu_arch == "x64") {
14 import("//third_party/yasm/yasm_assemble.gni")
16 yasm_assemble("simd_asm") {
19 if (cpu_arch == "x86") {
58 } else if (cpu_arch == "x64") {
60 "simd/jccolss2-64.asm",
61 "simd/jcgrass2-64.asm",
62 "simd/jcqnts2f-64.asm",
63 "simd/jcqnts2i-64.asm",
64 "simd/jcsamss2-64.asm",
65 "simd/jdcolss2-64.asm",
66 "simd/jdmerss2-64.asm",
67 "simd/jdsamss2-64.asm",
68 "simd/jfss2fst-64.asm",
69 "simd/jfss2int-64.asm",
70 "simd/jfsseflt-64.asm",
71 "simd/jiss2flt-64.asm",
72 "simd/jiss2fst-64.asm",
73 "simd/jiss2int-64.asm",
74 "simd/jiss2red-64.asm",
85 include_dirs = [ "win" ]
86 if (cpu_arch == "x86") {
99 include_dirs = [ "mac" ]
100 } else if (is_linux) {
104 include_dirs = [ "linux" ]
111 if (cpu_arch == "x86") {
112 deps = [ ":simd_asm" ]
116 } else if (cpu_arch == "x64") {
117 deps = [ ":simd_asm" ]
119 "simd/jsimd_x86_64.c",
121 } else if (cpu_arch == "arm" && arm_version >= 7 &&
122 (arm_use_neon || arm_optionally_use_neon)) {
125 "simd/jsimd_arm_neon.S",
128 sources = [ "jsimd_none.c" ]
132 config("libjpeg_config") {
133 include_dirs = [ "." ]
136 source_set("libjpeg") {
198 "MOTION_JPEG_SUPPORTED",
202 configs += [ ":libjpeg_config" ]
204 direct_dependent_configs = [ ":libjpeg_config" ]
206 # MemorySanitizer doesn't support assembly code, so keep it disabled in
207 # MSan builds for now.
208 # TODO: Enable on Linux when .asm files are recognized.
209 if (is_msan || is_linux) {
210 sources += [ "jsimd_none.c" ]
215 # TODO(GYP): Compile the .asm files with YASM as GYP does.