msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 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 | 'xcode_settings': { |
| 7 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 8 | }, |
| 9 | 'variables': { |
| 10 | 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/externals/libjpeg-turbo', |
| 11 | 'conditions': [ |
| 12 | [ 'skia_os == "win"', { |
| 13 | 'object_suffix': 'obj', |
| 14 | }, { |
| 15 | 'object_suffix': 'o', |
| 16 | }], |
| 17 | ], |
| 18 | }, |
| 19 | 'targets': [ |
| 20 | { |
msarett | 718e41d | 2015-07-10 10:59:47 -0700 | [diff] [blame] | 21 | 'target_name': 'yasm-win', |
| 22 | 'type': 'executable', |
| 23 | 'sources': [ |
| 24 | '../third_party/externals/yasm/binaries/win/yasm.exe', |
| 25 | ], |
| 26 | 'copies' : [{ |
| 27 | 'destination': '<(PRODUCT_DIR)', |
| 28 | 'files': [ '../third_party/externals/yasm/binaries/win/yasm.exe' ], |
| 29 | }], |
| 30 | }, |
| 31 | { |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 32 | 'target_name': 'libjpeg-turbo', |
| 33 | 'type': 'static_library', |
| 34 | 'include_dirs': [ |
| 35 | '../third_party/externals/libjpeg-turbo/', |
| 36 | ], |
| 37 | 'defines': [ |
| 38 | 'WITH_SIMD', |
| 39 | 'MOTION_JPEG_SUPPORTED', |
| 40 | 'NO_GETENV', |
| 41 | ], |
| 42 | 'cflags': [ |
| 43 | '-w', # supresses warnings |
| 44 | ], |
| 45 | 'msvs_settings': { |
| 46 | 'VCCLCompilerTool': { |
msarett | 718e41d | 2015-07-10 10:59:47 -0700 | [diff] [blame] | 47 | 'WarningLevel': '0', |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 48 | }, |
| 49 | }, |
| 50 | 'xcode_settings': { |
| 51 | 'WARNING_CFLAGS': [ |
| 52 | '-w', |
| 53 | ], |
| 54 | }, |
| 55 | 'sources': [ |
| 56 | '../third_party/externals/libjpeg-turbo/jaricom.c', |
| 57 | '../third_party/externals/libjpeg-turbo/jcapimin.c', |
| 58 | '../third_party/externals/libjpeg-turbo/jcapistd.c', |
| 59 | '../third_party/externals/libjpeg-turbo/jcarith.c', |
| 60 | '../third_party/externals/libjpeg-turbo/jccoefct.c', |
| 61 | '../third_party/externals/libjpeg-turbo/jccolor.c', |
| 62 | '../third_party/externals/libjpeg-turbo/jcdctmgr.c', |
| 63 | '../third_party/externals/libjpeg-turbo/jchuff.c', |
| 64 | '../third_party/externals/libjpeg-turbo/jchuff.h', |
| 65 | '../third_party/externals/libjpeg-turbo/jcinit.c', |
| 66 | '../third_party/externals/libjpeg-turbo/jcmainct.c', |
| 67 | '../third_party/externals/libjpeg-turbo/jcmarker.c', |
| 68 | '../third_party/externals/libjpeg-turbo/jcmaster.c', |
| 69 | '../third_party/externals/libjpeg-turbo/jcomapi.c', |
| 70 | '../third_party/externals/libjpeg-turbo/jconfig.h', |
| 71 | '../third_party/externals/libjpeg-turbo/jconfigint.h', |
| 72 | '../third_party/externals/libjpeg-turbo/jcparam.c', |
| 73 | '../third_party/externals/libjpeg-turbo/jcphuff.c', |
| 74 | '../third_party/externals/libjpeg-turbo/jcprepct.c', |
| 75 | '../third_party/externals/libjpeg-turbo/jcsample.c', |
| 76 | '../third_party/externals/libjpeg-turbo/jdapimin.c', |
| 77 | '../third_party/externals/libjpeg-turbo/jdapistd.c', |
| 78 | '../third_party/externals/libjpeg-turbo/jdarith.c', |
| 79 | '../third_party/externals/libjpeg-turbo/jdcoefct.c', |
| 80 | '../third_party/externals/libjpeg-turbo/jdcolor.c', |
| 81 | '../third_party/externals/libjpeg-turbo/jdct.h', |
| 82 | '../third_party/externals/libjpeg-turbo/jddctmgr.c', |
| 83 | '../third_party/externals/libjpeg-turbo/jdhuff.c', |
| 84 | '../third_party/externals/libjpeg-turbo/jdhuff.h', |
| 85 | '../third_party/externals/libjpeg-turbo/jdinput.c', |
| 86 | '../third_party/externals/libjpeg-turbo/jdmainct.c', |
| 87 | '../third_party/externals/libjpeg-turbo/jdmarker.c', |
| 88 | '../third_party/externals/libjpeg-turbo/jdmaster.c', |
| 89 | '../third_party/externals/libjpeg-turbo/jdmerge.c', |
| 90 | '../third_party/externals/libjpeg-turbo/jdphuff.c', |
| 91 | '../third_party/externals/libjpeg-turbo/jdpostct.c', |
| 92 | '../third_party/externals/libjpeg-turbo/jdsample.c', |
| 93 | '../third_party/externals/libjpeg-turbo/jerror.c', |
| 94 | '../third_party/externals/libjpeg-turbo/jerror.h', |
| 95 | '../third_party/externals/libjpeg-turbo/jfdctflt.c', |
| 96 | '../third_party/externals/libjpeg-turbo/jfdctfst.c', |
| 97 | '../third_party/externals/libjpeg-turbo/jfdctint.c', |
| 98 | '../third_party/externals/libjpeg-turbo/jidctflt.c', |
| 99 | '../third_party/externals/libjpeg-turbo/jidctfst.c', |
| 100 | '../third_party/externals/libjpeg-turbo/jidctint.c', |
| 101 | '../third_party/externals/libjpeg-turbo/jidctred.c', |
| 102 | '../third_party/externals/libjpeg-turbo/jinclude.h', |
| 103 | '../third_party/externals/libjpeg-turbo/jmemmgr.c', |
| 104 | '../third_party/externals/libjpeg-turbo/jmemnobs.c', |
| 105 | '../third_party/externals/libjpeg-turbo/jmemsys.h', |
| 106 | '../third_party/externals/libjpeg-turbo/jmorecfg.h', |
| 107 | '../third_party/externals/libjpeg-turbo/jpegint.h', |
| 108 | '../third_party/externals/libjpeg-turbo/jpeglib.h', |
| 109 | '../third_party/externals/libjpeg-turbo/jpeglibmangler.h', |
| 110 | '../third_party/externals/libjpeg-turbo/jquant1.c', |
| 111 | '../third_party/externals/libjpeg-turbo/jquant2.c', |
| 112 | '../third_party/externals/libjpeg-turbo/jutils.c', |
| 113 | '../third_party/externals/libjpeg-turbo/jversion.h', |
| 114 | ], |
| 115 | 'direct_dependent_settings': { |
| 116 | 'include_dirs': [ |
| 117 | '../third_party/externals/libjpeg-turbo/', |
| 118 | ], |
| 119 | }, |
| 120 | 'msvs_disabled_warnings': [4018, 4101], |
| 121 | # VS2010 does not correctly incrementally link obj files generated |
| 122 | # from asm files. This flag disables UseLibraryDependencyInputs to |
| 123 | # avoid this problem. |
| 124 | 'msvs_2010_disable_uldi_when_referenced': 1, |
msarett | 72394ef | 2015-07-09 07:55:01 -0700 | [diff] [blame] | 125 | |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 126 | # Add target-specific source files. |
| 127 | 'conditions': [ |
msarett | cf2a6a4 | 2015-07-21 12:01:48 -0700 | [diff] [blame] | 128 | # TODO (msarett): Is it possible to enable cross compiling for Android on other platforms? |
| 129 | [ 'skia_os == "android" and host_os != "linux" and "x86" in skia_arch_type', { |
| 130 | 'sources': [ |
| 131 | '../third_party/externals/libjpeg-turbo/jsimd_none.c', |
| 132 | ], |
msarett | 72394ef | 2015-07-09 07:55:01 -0700 | [diff] [blame] | 133 | }], |
msarett | cf2a6a4 | 2015-07-21 12:01:48 -0700 | [diff] [blame] | 134 | [ 'skia_arch_type == "x86" and (skia_os != "android" or host_os == "linux")', { |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 135 | 'sources': [ |
| 136 | '../third_party/externals/libjpeg-turbo/simd/jsimd_i386.c', |
| 137 | '../third_party/externals/libjpeg-turbo/simd/jccolor-mmx.asm', |
| 138 | '../third_party/externals/libjpeg-turbo/simd/jccolor-sse2.asm', |
| 139 | '../third_party/externals/libjpeg-turbo/simd/jcgray-mmx.asm', |
| 140 | '../third_party/externals/libjpeg-turbo/simd/jcgray-sse2.asm', |
| 141 | '../third_party/externals/libjpeg-turbo/simd/jcsample-mmx.asm', |
| 142 | '../third_party/externals/libjpeg-turbo/simd/jcsample-sse2.asm', |
| 143 | '../third_party/externals/libjpeg-turbo/simd/jdcolor-mmx.asm', |
| 144 | '../third_party/externals/libjpeg-turbo/simd/jdcolor-sse2.asm', |
| 145 | '../third_party/externals/libjpeg-turbo/simd/jdmerge-mmx.asm', |
| 146 | '../third_party/externals/libjpeg-turbo/simd/jdmerge-sse2.asm', |
| 147 | '../third_party/externals/libjpeg-turbo/simd/jdsample-mmx.asm', |
| 148 | '../third_party/externals/libjpeg-turbo/simd/jdsample-sse2.asm', |
| 149 | '../third_party/externals/libjpeg-turbo/simd/jfdctflt-3dn.asm', |
| 150 | '../third_party/externals/libjpeg-turbo/simd/jfdctflt-sse.asm', |
| 151 | '../third_party/externals/libjpeg-turbo/simd/jfdctfst-mmx.asm', |
| 152 | '../third_party/externals/libjpeg-turbo/simd/jfdctfst-sse2.asm', |
| 153 | '../third_party/externals/libjpeg-turbo/simd/jfdctint-mmx.asm', |
| 154 | '../third_party/externals/libjpeg-turbo/simd/jfdctint-sse2.asm', |
| 155 | '../third_party/externals/libjpeg-turbo/simd/jidctflt-3dn.asm', |
| 156 | '../third_party/externals/libjpeg-turbo/simd/jidctflt-sse2.asm', |
| 157 | '../third_party/externals/libjpeg-turbo/simd/jidctflt-sse.asm', |
| 158 | '../third_party/externals/libjpeg-turbo/simd/jidctfst-mmx.asm', |
| 159 | '../third_party/externals/libjpeg-turbo/simd/jidctfst-sse2.asm', |
| 160 | '../third_party/externals/libjpeg-turbo/simd/jidctint-mmx.asm', |
| 161 | '../third_party/externals/libjpeg-turbo/simd/jidctint-sse2.asm', |
| 162 | '../third_party/externals/libjpeg-turbo/simd/jidctred-mmx.asm', |
| 163 | '../third_party/externals/libjpeg-turbo/simd/jidctred-sse2.asm', |
| 164 | '../third_party/externals/libjpeg-turbo/simd/jquant-3dn.asm', |
| 165 | '../third_party/externals/libjpeg-turbo/simd/jquantf-sse2.asm', |
| 166 | '../third_party/externals/libjpeg-turbo/simd/jquanti-sse2.asm', |
| 167 | '../third_party/externals/libjpeg-turbo/simd/jquant-mmx.asm', |
| 168 | '../third_party/externals/libjpeg-turbo/simd/jquant-sse.asm', |
| 169 | '../third_party/externals/libjpeg-turbo/simd/jsimdcpu.asm', |
| 170 | ], |
| 171 | }], |
msarett | cf2a6a4 | 2015-07-21 12:01:48 -0700 | [diff] [blame] | 172 | [ 'skia_arch_type == "x86_64" and (skia_os != "android" or host_os == "linux")', { |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 173 | 'sources': [ |
| 174 | '../third_party/externals/libjpeg-turbo/simd/jsimd_x86_64.c', |
| 175 | '../third_party/externals/libjpeg-turbo/simd/jccolor-sse2-64.asm', |
| 176 | '../third_party/externals/libjpeg-turbo/simd/jcgray-sse2-64.asm', |
| 177 | '../third_party/externals/libjpeg-turbo/simd/jcsample-sse2-64.asm', |
| 178 | '../third_party/externals/libjpeg-turbo/simd/jdcolor-sse2-64.asm', |
| 179 | '../third_party/externals/libjpeg-turbo/simd/jdmerge-sse2-64.asm', |
| 180 | '../third_party/externals/libjpeg-turbo/simd/jdsample-sse2-64.asm', |
| 181 | '../third_party/externals/libjpeg-turbo/simd/jfdctflt-sse-64.asm', |
| 182 | '../third_party/externals/libjpeg-turbo/simd/jfdctfst-sse2-64.asm', |
| 183 | '../third_party/externals/libjpeg-turbo/simd/jfdctint-sse2-64.asm', |
| 184 | '../third_party/externals/libjpeg-turbo/simd/jidctflt-sse2-64.asm', |
| 185 | '../third_party/externals/libjpeg-turbo/simd/jidctfst-sse2-64.asm', |
| 186 | '../third_party/externals/libjpeg-turbo/simd/jidctint-sse2-64.asm', |
| 187 | '../third_party/externals/libjpeg-turbo/simd/jidctred-sse2-64.asm', |
| 188 | '../third_party/externals/libjpeg-turbo/simd/jquantf-sse2-64.asm', |
| 189 | '../third_party/externals/libjpeg-turbo/simd/jquanti-sse2-64.asm', |
| 190 | ], |
| 191 | }], |
| 192 | [ 'skia_arch_type == "arm64"', { |
| 193 | 'sources': [ |
| 194 | '../third_party/externals/libjpeg-turbo/simd/jsimd_arm64.c', |
| 195 | '../third_party/externals/libjpeg-turbo/simd/jsimd_arm64_neon.S', |
| 196 | ], |
| 197 | }], |
| 198 | [ 'skia_arch_type == "arm"', { |
| 199 | 'conditions': [ |
| 200 | [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', { |
| 201 | 'sources': [ |
| 202 | '../third_party/externals/libjpeg-turbo/simd/jsimd_arm.c', |
| 203 | '../third_party/externals/libjpeg-turbo/simd/jsimd_arm_neon.S', |
| 204 | ], |
| 205 | }, { |
| 206 | 'sources': [ |
| 207 | '../third_party/externals/libjpeg-turbo/jsimd_none.c', |
| 208 | ], |
| 209 | }], |
| 210 | ], |
| 211 | }], |
Brian Salomon | 4239fc2 | 2015-07-27 09:10:36 -0400 | [diff] [blame] | 212 | [ 'skia_arch_type == "mips64"', { |
| 213 | 'sources': [ |
| 214 | '../third_party/externals/libjpeg-turbo/simd/jsimd_mips.c', |
| 215 | '../third_party/externals/libjpeg-turbo/simd/jsimd_mips_dspr2_asm.h', |
| 216 | '../third_party/externals/libjpeg-turbo/simd/jsimd_mips_dspr2.S', |
| 217 | ], |
| 218 | }], |
| 219 | [ 'skia_arch_type == "mips32"', { |
| 220 | 'sources': [ |
| 221 | '../third_party/externals/libjpeg-turbo/jsimd_none.c', |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 222 | ], |
| 223 | }], |
| 224 | |
| 225 | # Build rules for an asm file. |
| 226 | # On Windows, we use the precompiled yasm binary. |
msarett | 718e41d | 2015-07-10 10:59:47 -0700 | [diff] [blame] | 227 | # On Linux, we build our patched yasm and use it. |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 228 | # On Mac, we always build our patched yasm and use it. |
| 229 | [ 'skia_os == "win"', { |
msarett | 718e41d | 2015-07-10 10:59:47 -0700 | [diff] [blame] | 230 | 'dependencies': [ |
| 231 | 'yasm-win', |
| 232 | ], |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 233 | 'variables': { |
msarett | 718e41d | 2015-07-10 10:59:47 -0700 | [diff] [blame] | 234 | 'yasm_path': '<(PRODUCT_DIR)/yasm.exe', |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 235 | 'conditions': [ |
| 236 | [ 'skia_arch_type == "x86"', { |
| 237 | 'yasm_format': '-fwin32', |
| 238 | 'yasm_flags': [ |
| 239 | '-D__x86__', |
| 240 | '-DWIN32', |
| 241 | '-DMSVC', |
| 242 | '-Iwin/' |
| 243 | ], |
| 244 | }, { |
| 245 | 'yasm_format': '-fwin64', |
| 246 | 'yasm_flags': [ |
| 247 | '-D__x86_64__', |
| 248 | '-DWIN64', |
| 249 | '-DMSVC', |
| 250 | '-Iwin/' |
| 251 | ], |
| 252 | }], |
| 253 | ], |
| 254 | }, |
| 255 | }], |
msarett | cf2a6a4 | 2015-07-21 12:01:48 -0700 | [diff] [blame] | 256 | [ 'skia_os == "android" and host_os == "linux" and \ |
| 257 | (skia_arch_type == "x86" or skia_arch_type == "x86_64")', { |
| 258 | 'dependencies': [ |
| 259 | 'yasm.gyp:yasm#host', |
| 260 | ], |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 261 | 'variables': { |
msarett | cf2a6a4 | 2015-07-21 12:01:48 -0700 | [diff] [blame] | 262 | 'yasm_path': '<(PRODUCT_DIR)/yasm', |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 263 | 'conditions': [ |
| 264 | [ 'skia_arch_type == "x86"', { |
| 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 | [ '(skia_os == "mac" or skia_os == "ios") and \ |
| 283 | (skia_arch_type == "x86" or skia_arch_type == "x86_64")', { |
| 284 | 'dependencies': [ |
| 285 | 'yasm.gyp:yasm#host', |
| 286 | ], |
| 287 | 'variables': { |
| 288 | 'yasm_path': '<(PRODUCT_DIR)/yasm', |
| 289 | 'conditions': [ |
| 290 | [ 'skia_arch_type == "x86"', { |
| 291 | 'yasm_format': '-fmacho', |
| 292 | 'yasm_flags': [ |
| 293 | '-D__x86__', |
| 294 | '-DMACHO', |
| 295 | '-Imac/' |
| 296 | ], |
| 297 | }, { |
| 298 | 'yasm_format': '-fmacho64', |
| 299 | 'yasm_flags': [ |
| 300 | '-D__x86_64__', |
| 301 | '-DMACHO', |
| 302 | '-Imac/' |
| 303 | ], |
| 304 | }], |
| 305 | ], |
| 306 | }, |
| 307 | }], |
| 308 | [ '(skia_os == "linux" or skia_os == "freebsd" or skia_os == "openbsd" or \ |
| 309 | skia_os == "solaris" or skia_os == "chromeos")', { |
| 310 | 'dependencies': [ |
| 311 | 'yasm.gyp:yasm#host', |
| 312 | ], |
| 313 | 'variables': { |
| 314 | 'yasm_path': '<(PRODUCT_DIR)/yasm', |
| 315 | 'conditions': [ |
| 316 | [ 'skia_arch_type == "x86"', { |
| 317 | 'yasm_format': '-felf', |
| 318 | 'yasm_flags': [ |
| 319 | '-D__x86__', |
| 320 | '-DELF', |
| 321 | '-Ilinux/' |
| 322 | ], |
| 323 | }, { |
| 324 | 'yasm_format': '-felf64', |
| 325 | 'yasm_flags': [ |
| 326 | '-D__x86_64__', |
| 327 | '-DELF', |
| 328 | '-Ilinux/' |
| 329 | ], |
| 330 | }], |
| 331 | ], |
| 332 | }, |
| 333 | }], |
| 334 | ], |
| 335 | 'rules': [ |
| 336 | { |
| 337 | 'rule_name': 'assemble', |
| 338 | 'extension': 'asm', |
| 339 | 'conditions': [ |
msarett | a56884c | 2015-07-23 11:57:13 -0700 | [diff] [blame] | 340 | [ '(skia_arch_type == "x86" or skia_arch_type == "x86_64") and \ |
| 341 | (skia_os != "android" or host_os == "linux")', { |
msarett | 1c8a587 | 2015-07-07 08:50:01 -0700 | [diff] [blame] | 342 | 'inputs': [], |
| 343 | 'outputs': [ |
| 344 | '<(shared_generated_dir)/<(RULE_INPUT_ROOT).<(object_suffix)', |
| 345 | ], |
| 346 | 'action': [ |
| 347 | '<(yasm_path)', |
| 348 | '<(yasm_format)', |
| 349 | '<@(yasm_flags)', |
| 350 | '-DRGBX_FILLER_0XFF', |
| 351 | '-DSTRICT_MEMORY_ACCESS', |
| 352 | '-Isimd/', |
| 353 | '-o', '<(shared_generated_dir)/<(RULE_INPUT_ROOT).<(object_suffix)', |
| 354 | '<(RULE_INPUT_PATH)', |
| 355 | ], |
| 356 | 'process_outputs_as_sources': 1, |
| 357 | 'message': 'Building <(RULE_INPUT_ROOT).<(object_suffix)', |
| 358 | }], |
| 359 | ] |
| 360 | }, |
| 361 | ], |
| 362 | }, |
| 363 | ], |
| 364 | } |