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. 4 5 config("libwebp_config") { 6 include_dirs = [ "." ] 7 } 8 9 source_set("libwebp_dec") { 10 sources = [ 11 "dec/alpha.c", 12 "dec/buffer.c", 13 "dec/frame.c", 14 "dec/idec.c", 15 "dec/io.c", 16 "dec/quant.c", 17 "dec/tree.c", 18 "dec/vp8.c", 19 "dec/vp8l.c", 20 "dec/webp.c", 21 ] 22 23 configs -= [ "//build/config/compiler:chromium_code" ] 24 configs += [ "//build/config/compiler:no_chromium_code" ] 25 26 deps = [ 27 ":libwebp_dsp", 28 # TODO(GYP): 29 # ":libwebp_dsp_neon", 30 ":libwebp_utils", 31 ] 32 all_dependent_configs = [ 33 ":libwebp_config" 34 ] 35 } 36 37 source_set("libwebp_demux") { 38 sources = [ 39 "demux/demux.c", 40 ] 41 all_dependent_configs = [ 42 ":libwebp_config" 43 ] 44 configs -= [ "//build/config/compiler:chromium_code" ] 45 configs += [ "//build/config/compiler:no_chromium_code" ] 46 } 47 48 49 source_set("libwebp_dsp") { 50 sources = [ 51 "dsp/alpha_processing.c", 52 "dsp/cpu.c", 53 "dsp/dec.c", 54 "dsp/dec_clip_tables.c", 55 "dsp/dec_mips32.c", 56 "dsp/dec_sse2.c", 57 "dsp/enc.c", 58 "dsp/enc_avx2.c", 59 "dsp/enc_mips32.c", 60 "dsp/enc_sse2.c", 61 "dsp/lossless.c", 62 "dsp/lossless_mips32.c", 63 "dsp/lossless_sse2.c", 64 "dsp/upsampling.c", 65 "dsp/upsampling_sse2.c", 66 "dsp/yuv.c", 67 "dsp/yuv_mips32.c", 68 "dsp/yuv_sse2.c", 69 ] 70 configs -= [ "//build/config/compiler:chromium_code" ] 71 configs += [ "//build/config/compiler:no_chromium_code" ] 72 73 all_dependent_configs = [ 74 ":libwebp_config" 75 ] 76 deps = [] 77 if (is_android) { 78 deps += [ "//third_party/android_tools:cpu_features" ] 79 } 80 # TODO(GYP): 81 # 'conditions': [ 82 # ['order_profiling != 0', { 83 # 'target_conditions' : [ 84 # ['_toolset=="target"', { 85 # 'cflags!': [ '-finstrument-functions' ], 86 # }], 87 # ], 88 # }], 89 # ], 90 } 91 92 # TODO(GYP): 93 # 'variables': { 94 # 'neon_sources': [ 95 # "dsp/dec_neon.c", 96 # "dsp/enc_neon.c", 97 # "dsp/lossless_neon.c", 98 # "dsp/upsampling_neon.c", 99 # ] 100 # }, 101 # { 102 # 'target_name': 'libwebp_dsp_neon', 103 # 'conditions': [ 104 # ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', { 105 # 'type': 'static_library', 106 # 'include_dirs': ['.'], 107 # 'sources': [ 108 # '<@(neon_sources)' 109 # ], 110 # # behavior similar to *.c.neon in an Android.mk 111 # 'cflags!': [ '-mfpu=vfpv3-d16' ], 112 # 'cflags': [ '-mfpu=neon' ], 113 # },{ 114 # 'conditions': [ 115 # ['target_arch == "arm64"', { 116 # 'type': 'static_library', 117 # 'include_dirs': ['.'], 118 # 'sources': [ 119 # '<@(neon_sources)' 120 # ], 121 # # avoid an ICE with gcc-4.9: b/15574841 122 # 'cflags': [ '-frename-registers' ], 123 # },{ # "target_arch != "arm|arm64" or arm_version < 7" 124 # 'type': 'none', 125 # }], 126 # ], 127 # }], 128 # ['order_profiling != 0', { 129 # 'target_conditions' : [ 130 # ['_toolset=="target"', { 131 # 'cflags!': [ '-finstrument-functions' ], 132 # }], 133 # ], 134 # }], 135 # ], 136 # } 137 138 source_set("libwebp_enc") { 139 sources = [ 140 "enc/alpha.c", 141 "enc/analysis.c", 142 "enc/backward_references.c", 143 "enc/config.c", 144 "enc/cost.c", 145 "enc/filter.c", 146 "enc/frame.c", 147 "enc/histogram.c", 148 "enc/iterator.c", 149 "enc/picture.c", 150 "enc/picture_csp.c", 151 "enc/picture_psnr.c", 152 "enc/picture_rescale.c", 153 "enc/picture_tools.c", 154 "enc/quant.c", 155 "enc/syntax.c", 156 "enc/token.c", 157 "enc/tree.c", 158 "enc/vp8l.c", 159 "enc/webpenc.c", 160 ] 161 configs -= [ "//build/config/compiler:chromium_code" ] 162 configs += [ "//build/config/compiler:no_chromium_code" ] 163 164 all_dependent_configs = [ 165 ":libwebp_config" 166 ] 167 } 168 169 source_set("libwebp_utils") { 170 sources = [ 171 "utils/bit_reader.c", 172 "utils/bit_writer.c", 173 "utils/color_cache.c", 174 "utils/filters.c", 175 "utils/huffman.c", 176 "utils/huffman_encode.c", 177 "utils/quant_levels.c", 178 "utils/quant_levels_dec.c", 179 "utils/random.c", 180 "utils/rescaler.c", 181 "utils/thread.c", 182 "utils/utils.c", 183 ] 184 configs -= [ "//build/config/compiler:chromium_code" ] 185 configs += [ "//build/config/compiler:no_chromium_code" ] 186 187 all_dependent_configs = [ 188 ":libwebp_config" 189 ] 190 } 191 192 group("libwebp") { 193 deps = [ 194 ":libwebp_dec", 195 ":libwebp_demux", 196 ":libwebp_dsp", 197 # TODO(GYP): 198 # ":libwebp_dsp_neon", 199 ":libwebp_enc", 200 ":libwebp_utils", 201 ] 202 direct_dependent_configs = [ 203 ":libwebp_config" 204 ] 205 } 206