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 (current_cpu == "arm") {
9 import("//build/config/arm.gni")
12 if (current_cpu == "x86" || current_cpu == "x64") {
13 import("//third_party/yasm/yasm_assemble.gni")
15 yasm_assemble("simd_asm") {
18 if (current_cpu == "x86") {
54 defines += [ "__x86__" ]
55 } else if (current_cpu == "x64") {
57 "simd/jccolss2-64.asm",
58 "simd/jcgrass2-64.asm",
59 "simd/jcqnts2f-64.asm",
60 "simd/jcqnts2i-64.asm",
61 "simd/jcsamss2-64.asm",
62 "simd/jdcolss2-64.asm",
63 "simd/jdmerss2-64.asm",
64 "simd/jdsamss2-64.asm",
65 "simd/jfss2fst-64.asm",
66 "simd/jfss2int-64.asm",
67 "simd/jfsseflt-64.asm",
68 "simd/jiss2flt-64.asm",
69 "simd/jiss2fst-64.asm",
70 "simd/jiss2int-64.asm",
71 "simd/jiss2red-64.asm",
73 defines += [ "__x86_64__" ]
78 include_dirs = [ "win" ]
79 if (current_cpu == "x86") {
80 defines += [ "WIN32" ]
82 defines += [ "WIN64" ]
85 defines += [ "MACHO" ]
86 include_dirs = [ "mac" ]
87 } else if (is_linux || is_android) {
89 include_dirs = [ "linux" ]
95 if (current_cpu == "x86") {
103 cflags = [ "/wd4245" ]
105 } else if (current_cpu == "x64") {
110 "simd/jsimd_x86_64.c",
112 } else if (current_cpu == "arm" && arm_version >= 7 &&
113 (arm_use_neon || arm_optionally_use_neon)) {
116 "simd/jsimd_arm_neon.S",
125 config("libjpeg_config") {
126 include_dirs = [ "." ]
129 source_set("libjpeg") {
191 "MOTION_JPEG_SUPPORTED",
195 configs += [ ":libjpeg_config" ]
197 public_configs = [ ":libjpeg_config" ]
199 # MemorySanitizer doesn't support assembly code, so keep it disabled in
200 # MSan builds for now.
201 # TODO: Enable on Linux when .asm files are recognized.
202 if (is_msan || is_linux) {
203 sources += [ "jsimd_none.c" ]
210 # TODO(GYP): Compile the .asm files with YASM as GYP does.