# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { # This file is not used when use_system_libjpeg==1. Settings for building with # the system libjpeg is in third_party/libjpeg/libjpeg.gyp. 'variables': { 'use_system_yasm%': 0, 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libjpeg_turbo', 'conditions': [ [ 'OS=="win"', { 'object_suffix': 'obj', }, { 'object_suffix': 'o', }], ], }, 'targets': [ { 'target_name': 'libjpeg', 'type': 'static_library', 'include_dirs': [ '.', ], 'defines': [ 'WITH_SIMD', 'NO_GETENV', ], 'sources': [ 'jcapimin.c', 'jcapistd.c', 'jccoefct.c', 'jccolor.c', 'jcdctmgr.c', 'jchuff.c', 'jchuff.h', 'jcinit.c', 'jcmainct.c', 'jcmarker.c', 'jcmaster.c', 'jcomapi.c', 'jconfig.h', 'jcparam.c', 'jcphuff.c', 'jcprepct.c', 'jcsample.c', 'jdapimin.c', 'jdapistd.c', 'jdatadst.c', 'jdatasrc.c', 'jdcoefct.c', 'jdcolor.c', 'jdct.h', 'jddctmgr.c', 'jdhuff.c', 'jdhuff.h', 'jdinput.c', 'jdmainct.c', 'jdmarker.c', 'jdmaster.c', 'jdmerge.c', 'jdphuff.c', 'jdpostct.c', 'jdsample.c', 'jerror.c', 'jerror.h', 'jfdctflt.c', 'jfdctfst.c', 'jfdctint.c', 'jidctflt.c', 'jidctfst.c', 'jidctint.c', 'jidctred.c', 'jinclude.h', 'jmemmgr.c', 'jmemnobs.c', 'jmemsys.h', 'jmorecfg.h', 'jpegint.h', 'jpeglib.h', 'jpeglibmangler.h', 'jquant1.c', 'jquant2.c', 'jutils.c', 'jversion.h', ], 'direct_dependent_settings': { 'include_dirs': [ '.', ], }, 'msvs_disabled_warnings': [4018, 4101], # VS2010 does not correctly incrementally link obj files generated # from asm files. This flag disables UseLibraryDependencyInputs to # avoid this problem. 'msvs_2010_disable_uldi_when_referenced': 1, 'conditions': [ [ 'OS!="win"', {'product_name': 'jpeg_turbo'}], # Add target-specific source files. [ 'target_arch=="ia32"', { 'sources': [ 'simd/jsimd_i386.c', 'simd/jccolor-mmx.asm', 'simd/jccolor-sse2.asm', 'simd/jcgray-mmx.asm', 'simd/jcgray-sse2.asm', 'simd/jchuff-sse2.asm', 'simd/jcsample-mmx.asm', 'simd/jcsample-sse2.asm', 'simd/jdcolor-mmx.asm', 'simd/jdcolor-sse2.asm', 'simd/jdmerge-mmx.asm', 'simd/jdmerge-sse2.asm', 'simd/jdsample-mmx.asm', 'simd/jdsample-sse2.asm', 'simd/jfdctflt-3dn.asm', 'simd/jfdctflt-sse.asm', 'simd/jfdctfst-mmx.asm', 'simd/jfdctfst-sse2.asm', 'simd/jfdctint-mmx.asm', 'simd/jfdctint-sse2.asm', 'simd/jidctflt-3dn.asm', 'simd/jidctflt-sse2.asm', 'simd/jidctflt-sse.asm', 'simd/jidctfst-mmx.asm', 'simd/jidctfst-sse2.asm', 'simd/jidctint-mmx.asm', 'simd/jidctint-sse2.asm', 'simd/jidctred-mmx.asm', 'simd/jidctred-sse2.asm', 'simd/jquant-3dn.asm', 'simd/jquantf-sse2.asm', 'simd/jquanti-sse2.asm', 'simd/jquant-mmx.asm', 'simd/jquant-sse.asm', 'simd/jsimdcpu.asm', ], }], [ 'target_arch=="x64" and msan!=1', { 'sources': [ 'simd/jsimd_x86_64.c', 'simd/jccolor-sse2-64.asm', 'simd/jcgray-sse2-64.asm', 'simd/jchuff-sse2-64.asm', 'simd/jcsample-sse2-64.asm', 'simd/jdcolor-sse2-64.asm', 'simd/jdmerge-sse2-64.asm', 'simd/jdsample-sse2-64.asm', 'simd/jfdctflt-sse-64.asm', 'simd/jfdctfst-sse2-64.asm', 'simd/jfdctint-sse2-64.asm', 'simd/jidctflt-sse2-64.asm', 'simd/jidctfst-sse2-64.asm', 'simd/jidctint-sse2-64.asm', 'simd/jidctred-sse2-64.asm', 'simd/jquantf-sse2-64.asm', 'simd/jquanti-sse2-64.asm', ], }], # MemorySanitizer doesn't support assembly code, so keep it disabled in # MSan builds for now. [ 'msan==1', { 'sources': [ 'jsimd_none.c', ], }], # The ARM SIMD implementation can be used for devices that support # the NEON instruction set. This can safely be done dynamically by # probing CPU features at runtime, if you wish. [ 'target_arch=="arm"', { 'conditions': [ [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', { 'sources': [ 'simd/jsimd_arm.c', 'simd/jsimd_arm_neon.S', ], }, { 'sources': [ 'jsimd_none.c', ], }] ], }], [ 'target_arch=="arm64"', { 'sources': [ 'simd/jsimd_arm64.c', 'simd/jsimd_arm64_neon.S', ], }], [ 'target_arch=="mipsel" or target_arch=="mips64el"', { 'sources': [ 'jsimd_none.c', ], }], # Build rules for an asm file. # On Windows, we use the precompiled yasm binary. On Linux, we build # our patched yasm and use it except when use_system_yasm is 1. On # Mac, we always build our patched yasm and use it because of # . [ 'OS=="win"', { 'variables': { 'yasm_path': '../yasm/binaries/win/yasm<(EXECUTABLE_SUFFIX)', 'conditions': [ [ 'target_arch=="ia32"', { 'yasm_format': '-fwin32', 'yasm_flags': [ '-D__x86__', '-DWIN32', '-DMSVC', ], }, { 'yasm_format': '-fwin64', 'yasm_flags': [ '-D__x86_64__', '-DWIN64', '-DMSVC', ], }], ], }, }], [ 'OS=="mac" or OS=="ios"', { 'dependencies': [ '../yasm/yasm.gyp:yasm#host', ], 'variables': { 'yasm_path': '<(PRODUCT_DIR)/yasm', 'conditions': [ [ 'target_arch=="ia32"', { 'yasm_format': '-fmacho', 'yasm_flags': [ '-D__x86__', '-DMACHO', ], }, { 'yasm_format': '-fmacho64', 'yasm_flags': [ '-D__x86_64__', '-DMACHO', ], }], ], }, }], [ 'OS=="linux" or OS=="freebsd" or (OS=="android" and (target_arch=="ia32" or target_arch=="x64"))', { 'conditions': [ [ 'use_system_yasm==0', { 'dependencies': [ '../yasm/yasm.gyp:yasm#host', ], }], ], 'variables': { 'conditions': [ [ 'use_system_yasm==1', { 'yasm_path': '