1 # Copyright (c) 2012 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. 4 5 { 6 # This file is not used when use_system_libjpeg==1. Settings for building with 7 # the system libjpeg is in third_party/libjpeg/libjpeg.gyp. 8 'variables': { 9 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libjpeg_turbo', 10 'conditions': [ 11 [ 'OS=="win"', { 12 'object_suffix': 'obj', 13 }, { 14 'object_suffix': 'o', 15 }], 16 ], 17 }, 18 'targets': [ 19 { 20 'target_name': 'libjpeg', 21 'type': 'static_library', 22 'include_dirs': [ 23 '.', 24 ], 25 'defines': [ 26 'WITH_SIMD', 27 'MOTION_JPEG_SUPPORTED', 28 'NO_GETENV', 29 ], 30 'sources': [ 31 'jcapimin.c', 32 'jcapistd.c', 33 'jccoefct.c', 34 'jccolor.c', 35 'jcdctmgr.c', 36 'jchuff.c', 37 'jchuff.h', 38 'jcinit.c', 39 'jcmainct.c', 40 'jcmarker.c', 41 'jcmaster.c', 42 'jcomapi.c', 43 'jconfig.h', 44 'jcparam.c', 45 'jcphuff.c', 46 'jcprepct.c', 47 'jcsample.c', 48 'jdapimin.c', 49 'jdapistd.c', 50 'jdatadst.c', 51 'jdatasrc.c', 52 'jdcoefct.c', 53 'jdcolor.c', 54 'jdct.h', 55 'jddctmgr.c', 56 'jdhuff.c', 57 'jdhuff.h', 58 'jdinput.c', 59 'jdmainct.c', 60 'jdmarker.c', 61 'jdmaster.c', 62 'jdmerge.c', 63 'jdphuff.c', 64 'jdpostct.c', 65 'jdsample.c', 66 'jerror.c', 67 'jerror.h', 68 'jfdctflt.c', 69 'jfdctfst.c', 70 'jfdctint.c', 71 'jidctflt.c', 72 'jidctfst.c', 73 'jidctint.c', 74 'jidctred.c', 75 'jinclude.h', 76 'jmemmgr.c', 77 'jmemnobs.c', 78 'jmemsys.h', 79 'jmorecfg.h', 80 'jpegint.h', 81 'jpeglib.h', 82 'jpeglibmangler.h', 83 'jquant1.c', 84 'jquant2.c', 85 'jutils.c', 86 'jversion.h', 87 ], 88 'direct_dependent_settings': { 89 'include_dirs': [ 90 '.', 91 ], 92 }, 93 'msvs_disabled_warnings': [4018, 4101], 94 # VS2010 does not correctly incrementally link obj files generated 95 # from asm files. This flag disables UseLibraryDependencyInputs to 96 # avoid this problem. 97 'msvs_2010_disable_uldi_when_referenced': 1, 98 'conditions': [ 99 [ 'OS!="win"', {'product_name': 'jpeg_turbo'}], 100 # Add target-specific source files. 101 [ 'target_arch=="ia32"', { 102 'sources': [ 103 'simd/jsimd_i386.c', 104 'simd/jccolmmx.asm', 105 'simd/jccolss2.asm', 106 'simd/jcgrammx.asm', 107 'simd/jcgrass2.asm', 108 'simd/jcqnt3dn.asm', 109 'simd/jcqntmmx.asm', 110 'simd/jcqnts2f.asm', 111 'simd/jcqnts2i.asm', 112 'simd/jcqntsse.asm', 113 'simd/jcsammmx.asm', 114 'simd/jcsamss2.asm', 115 'simd/jdcolmmx.asm', 116 'simd/jdcolss2.asm', 117 'simd/jdmermmx.asm', 118 'simd/jdmerss2.asm', 119 'simd/jdsammmx.asm', 120 'simd/jdsamss2.asm', 121 'simd/jf3dnflt.asm', 122 'simd/jfmmxfst.asm', 123 'simd/jfmmxint.asm', 124 'simd/jfss2fst.asm', 125 'simd/jfss2int.asm', 126 'simd/jfsseflt.asm', 127 'simd/ji3dnflt.asm', 128 'simd/jimmxfst.asm', 129 'simd/jimmxint.asm', 130 'simd/jimmxred.asm', 131 'simd/jiss2flt.asm', 132 'simd/jiss2fst.asm', 133 'simd/jiss2int.asm', 134 'simd/jiss2red.asm', 135 'simd/jisseflt.asm', 136 'simd/jsimdcpu.asm', 137 ], 138 }], 139 [ 'target_arch=="x64" and msan!=1', { 140 'sources': [ 141 'simd/jsimd_x86_64.c', 142 'simd/jccolss2-64.asm', 143 'simd/jcgrass2-64.asm', 144 'simd/jcqnts2f-64.asm', 145 'simd/jcqnts2i-64.asm', 146 'simd/jcsamss2-64.asm', 147 'simd/jdcolss2-64.asm', 148 'simd/jdmerss2-64.asm', 149 'simd/jdsamss2-64.asm', 150 'simd/jfss2fst-64.asm', 151 'simd/jfss2int-64.asm', 152 'simd/jfsseflt-64.asm', 153 'simd/jiss2flt-64.asm', 154 'simd/jiss2fst-64.asm', 155 'simd/jiss2int-64.asm', 156 'simd/jiss2red-64.asm', 157 ], 158 }], 159 # MemorySanitizer doesn't support assembly code, so keep it disabled in 160 # MSan builds for now. 161 [ 'msan==1', { 162 'sources': [ 163 'jsimd_none.c', 164 ], 165 }], 166 # The ARM SIMD implementation can be used for devices that support 167 # the NEON instruction set. This can safely be done dynamically by 168 # probing CPU features at runtime, if you wish. 169 [ 'target_arch=="arm"', { 170 'conditions': [ 171 [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', { 172 'sources': [ 173 'simd/jsimd_arm.c', 174 'simd/jsimd_arm_neon.S', 175 ], 176 }, { 177 'sources': [ 178 'jsimd_none.c', 179 ], 180 }] 181 ], 182 }], 183 [ 'target_arch=="arm64"', { 184 'sources': [ 185 'simd/jsimd_arm64.c', 186 'simd/jsimd_arm64_neon.S', 187 ], 188 }], 189 [ 'target_arch=="mipsel" or target_arch=="mips64el"', { 190 'sources': [ 191 'jsimd_none.c', 192 ], 193 }], 194 195 # Build rules for an asm file. 196 # On Windows, we use the precompiled yasm binary. On Linux, we build 197 # our patched yasm and use it except when use_system_yasm is 1. On 198 # Mac, we always build our patched yasm and use it because of 199 # <http://www.tortall.net/projects/yasm/ticket/236>. 200 [ 'OS=="win"', { 201 'variables': { 202 'yasm_path': '../yasm/binaries/win/yasm<(EXECUTABLE_SUFFIX)', 203 'conditions': [ 204 [ 'target_arch=="ia32"', { 205 'yasm_format': '-fwin32', 206 'yasm_flags': [ 207 '-D__x86__', 208 '-DWIN32', 209 '-DMSVC', 210 '-Iwin/' 211 ], 212 }, { 213 'yasm_format': '-fwin64', 214 'yasm_flags': [ 215 '-D__x86_64__', 216 '-DWIN64', 217 '-DMSVC', 218 '-Iwin/' 219 ], 220 }], 221 ], 222 }, 223 }], 224 [ 'OS=="mac" or OS=="ios"', { 225 'dependencies': [ 226 '../yasm/yasm.gyp:yasm#host', 227 ], 228 'variables': { 229 'yasm_path': '<(PRODUCT_DIR)/yasm', 230 'conditions': [ 231 [ 'target_arch=="ia32"', { 232 'yasm_format': '-fmacho', 233 'yasm_flags': [ 234 '-D__x86__', 235 '-DMACHO', 236 '-Imac/' 237 ], 238 }, { 239 'yasm_format': '-fmacho64', 240 'yasm_flags': [ 241 '-D__x86_64__', 242 '-DMACHO', 243 '-Imac/' 244 ], 245 }], 246 ], 247 }, 248 }], 249 [ 'OS=="linux" or OS=="freebsd" or (OS=="android" and (target_arch=="ia32" or target_arch=="x64"))', { 250 'conditions': [ 251 [ 'use_system_yasm==0', { 252 'dependencies': [ 253 '../yasm/yasm.gyp:yasm#host', 254 ], 255 }], 256 ], 257 'variables': { 258 'conditions': [ 259 [ 'use_system_yasm==1', { 260 'yasm_path': '<!(which yasm)', 261 }, { 262 'yasm_path': '<(PRODUCT_DIR)/yasm', 263 }], 264 [ 'target_arch=="ia32"', { 265 'yasm_format': '-felf', 266 'yasm_flags': [ 267 '-D__x86__', 268 '-DELF', 269 '-Ilinux/' 270 ], 271 }, { 272 'yasm_format': '-felf64', 273 'yasm_flags': [ 274 '-D__x86_64__', 275 '-DELF', 276 '-Ilinux/' 277 ], 278 }], 279 ], 280 }, 281 }], 282 ], 283 'rules': [ 284 { 285 'rule_name': 'assemble', 286 'extension': 'asm', 287 'conditions': [ 288 [ 'target_arch=="ia32" or target_arch=="x64"', { 289 'inputs': [ '<(yasm_path)', ], 290 'outputs': [ 291 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).<(object_suffix)', 292 ], 293 'action': [ 294 '<(yasm_path)', 295 '<(yasm_format)', 296 '<@(yasm_flags)', 297 '-DRGBX_FILLER_0XFF', 298 '-DSTRICT_MEMORY_ACCESS', 299 '-Isimd/', 300 '-o', '<(shared_generated_dir)/<(RULE_INPUT_ROOT).<(object_suffix)', 301 '<(RULE_INPUT_PATH)', 302 ], 303 'process_outputs_as_sources': 1, 304 'message': 'Building <(RULE_INPUT_ROOT).<(object_suffix)', 305 }], 306 ] 307 }, 308 ], 309 }, 310 ], 311 } 312 313 # Local Variables: 314 # tab-width:2 315 # indent-tabs-mode:nil 316 # End: 317 # vim: set expandtab tabstop=2 shiftwidth=2: 318