1# Copyright (c) 2009 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 'variables': { 7 'use_system_zlib%': 0, 8 'arm_fpu%': '', 9 'llvm_version%': '0.0', 10 }, 11 'conditions': [ 12 ['use_system_zlib==0', { 13 'targets': [ 14 { 15 'target_name': 'zlib', 16 'type': 'static_library', 17 'sources': [ 18 'adler32.c', 19 'compress.c', 20 'contrib/optimizations/insert_string.h', 21 'crc32.c', 22 'crc32.h', 23 'deflate.c', 24 'deflate.h', 25 'gzclose.c', 26 'gzguts.h', 27 'gzlib.c', 28 'gzread.c', 29 'gzwrite.c', 30 'infback.c', 31 'inffast.c', 32 'inffast.h', 33 'inffixed.h', 34 'inflate.h', 35 'inftrees.c', 36 'inftrees.h', 37 'trees.c', 38 'trees.h', 39 'uncompr.c', 40 'x86.h', 41 'zconf.h', 42 'zlib.h', 43 'zutil.c', 44 'zutil.h', 45 ], 46 'include_dirs': [ 47 '.', 48 ], 49 'direct_dependent_settings': { 50 'include_dirs': [ 51 '.', 52 ], 53 }, 54 'conditions': [ 55 ['OS!="win"', { 56 'cflags!': [ '-ansi' ], 57 'defines': [ 'HAVE_HIDDEN' ], 58 }], 59 ['OS=="mac" or OS=="ios" or OS=="freebsd" or OS=="android"', { 60 # Mac, Android and the BSDs don't have fopen64, ftello64, or 61 # fseeko64. We use fopen, ftell, and fseek instead on these 62 # systems. 63 'defines': [ 64 'USE_FILE32API' 65 ], 66 }], 67 ['(target_arch in "ia32 x64 x32" and OS!="ios") or arm_fpu=="neon"', { 68 'sources': [ 69 'adler32_simd.c', 70 'adler32_simd.h', 71 'contrib/optimizations/chunkcopy.h', 72 'contrib/optimizations/inffast_chunk.c', 73 'contrib/optimizations/inffast_chunk.h', 74 'contrib/optimizations/inflate.c', 75 ], 76 }, { 77 'sources': [ 'inflate.c', ], 78 }], 79 # Incorporate optimizations where possible 80 ['target_arch in "ia32 x64 x32" and OS!="ios"', { 81 'defines': [ 82 'ADLER32_SIMD_SSSE3', 83 'INFLATE_CHUNK_SIMD_SSE2', 84 'CRC32_SIMD_SSE42_PCLMUL', 85 ], 86 'sources': [ 87 'crc32_simd.c', 88 'crc32_simd.h', 89 'crc_folding.c', 90 'fill_window_sse.c', 91 'x86.c', 92 ], 93 'conditions': [ 94 ['target_arch=="x64"', { 95 'defines': [ 'INFLATE_CHUNK_READ_64LE' ], 96 }], 97 ], 98 }, { 99 'sources': [ 'simd_stub.c', ], 100 }], 101 ['arm_fpu=="neon"', { 102 'defines': [ 103 'ADLER32_SIMD_NEON', 104 'INFLATE_CHUNK_SIMD_NEON', 105 ], 106 'sources': [ 107 'contrib/optimizations/slide_hash_neon.h', 108 ], 109 'conditions': [ 110 ['OS!="ios"', { 111 'defines': [ 'CRC32_ARMV8_CRC32' ], 112 'sources': [ 113 'arm_features.c', 114 'arm_features.h', 115 'crc32_simd.c', 116 'crc32_simd.h', 117 ], 118 'conditions': [ 119 ['OS=="android"', { 120 'defines': [ 'ARMV8_OS_ANDROID' ], 121 }], 122 ['OS=="linux"', { 123 'defines': [ 'ARMV8_OS_LINUX' ], 124 }], 125 ['OS=="win"', { 126 'defines': [ 'ARMV8_OS_WINDOWS' ], 127 }], 128 ['OS!="android" and OS!="win" and llvm_version=="0.0"', { 129 'cflags': [ 130 '-march=armv8-a+crc', 131 ], 132 }], 133 ], 134 }], 135 ['target_arch=="arm64"', { 136 'defines': [ 'INFLATE_CHUNK_READ_64LE' ], 137 }], 138 ], 139 }], 140 ], 141 }, 142 ], 143 }, { 144 'targets': [ 145 { 146 'target_name': 'zlib', 147 'type': 'static_library', 148 'direct_dependent_settings': { 149 'defines': [ 150 'USE_SYSTEM_ZLIB', 151 ], 152 }, 153 'defines': [ 154 'USE_SYSTEM_ZLIB', 155 ], 156 'link_settings': { 157 'libraries': [ 158 '-lz', 159 ], 160 }, 161 }, 162 ], 163 }], 164 ], 165} 166