Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/arm.gni") | 5 import("//build/config/arm.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 | 7 |
| 8 config("libwebp_config") { | 8 config("libwebp_config") { |
| 9 include_dirs = [ "." ] | 9 include_dirs = [ "." ] |
| 10 } | 10 } |
| 11 | 11 |
| 12 set_opt_level = | 12 set_opt_level = |
| 13 !is_debug && is_posix && (current_cpu == "arm" || current_cpu == "arm64") | 13 !is_debug && is_posix && (current_cpu == "arm" || current_cpu == "arm64") |
| 14 | 14 |
| 15 use_dsp_neon = | 15 use_dsp_neon = |
| 16 current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 && | 16 current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 && |
| 17 (arm_use_neon || arm_optionally_use_neon)) | 17 (arm_use_neon || arm_optionally_use_neon)) |
| 18 | 18 |
| 19 source_set("libwebp_headers") { | |
| 20 sources = [ | |
| 21 "webp/format_constants.h", | |
| 22 "webp/mux_types.h", | |
| 23 "webp/types.h", | |
|
Nico
2017/05/01 13:29:41
This target feels kind of strange to me: Everythin
wychen
2017/05/01 18:26:06
That was what I did in ps1.
The reason I moved de
| |
| 24 ] | |
| 25 } | |
| 26 | |
| 19 static_library("libwebp_dec") { | 27 static_library("libwebp_dec") { |
| 20 sources = [ | 28 sources = [ |
| 21 "dec/alpha_dec.c", | 29 "dec/alpha_dec.c", |
| 30 "dec/alphai_dec.h", | |
| 22 "dec/buffer_dec.c", | 31 "dec/buffer_dec.c", |
| 32 "dec/common_dec.h", | |
| 23 "dec/frame_dec.c", | 33 "dec/frame_dec.c", |
| 24 "dec/idec_dec.c", | 34 "dec/idec_dec.c", |
| 25 "dec/io_dec.c", | 35 "dec/io_dec.c", |
| 26 "dec/quant_dec.c", | 36 "dec/quant_dec.c", |
| 27 "dec/tree_dec.c", | 37 "dec/tree_dec.c", |
| 28 "dec/vp8_dec.c", | 38 "dec/vp8_dec.c", |
| 39 "dec/vp8_dec.h", | |
| 40 "dec/vp8i_dec.h", | |
| 29 "dec/vp8l_dec.c", | 41 "dec/vp8l_dec.c", |
| 42 "dec/vp8li_dec.h", | |
| 30 "dec/webp_dec.c", | 43 "dec/webp_dec.c", |
| 44 "dec/webpi_dec.h", | |
| 45 "webp/decode.h", | |
| 31 ] | 46 ] |
| 32 | 47 |
| 33 configs -= [ "//build/config/compiler:chromium_code" ] | 48 configs -= [ "//build/config/compiler:chromium_code" ] |
| 34 configs += [ "//build/config/compiler:no_chromium_code" ] | 49 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 35 if (set_opt_level) { | 50 if (set_opt_level) { |
| 36 configs -= [ "//build/config/compiler:default_optimization" ] | 51 configs -= [ "//build/config/compiler:default_optimization" ] |
| 37 configs += [ "//build/config/compiler:optimize_max" ] | 52 configs += [ "//build/config/compiler:optimize_max" ] |
| 38 } | 53 } |
| 39 | 54 |
| 40 deps = [ | 55 deps = [ |
| 41 ":libwebp_dsp", | 56 ":libwebp_dsp", |
| 57 ":libwebp_headers", | |
| 42 ":libwebp_utils", | 58 ":libwebp_utils", |
| 43 ] | 59 ] |
| 44 all_dependent_configs = [ ":libwebp_config" ] | 60 all_dependent_configs = [ ":libwebp_config" ] |
| 45 if (use_dsp_neon) { | 61 if (use_dsp_neon) { |
| 46 deps += [ ":libwebp_dsp_neon" ] | 62 deps += [ ":libwebp_dsp_neon" ] |
| 47 } | 63 } |
| 48 } | 64 } |
| 49 | 65 |
| 50 static_library("libwebp_demux") { | 66 static_library("libwebp_demux") { |
| 51 sources = [ | 67 sources = [ |
| 52 "demux/demux.c", | 68 "demux/demux.c", |
| 69 "webp/demux.h", | |
| 53 ] | 70 ] |
| 54 all_dependent_configs = [ ":libwebp_config" ] | 71 all_dependent_configs = [ ":libwebp_config" ] |
| 55 configs -= [ "//build/config/compiler:chromium_code" ] | 72 configs -= [ "//build/config/compiler:chromium_code" ] |
| 56 configs += [ "//build/config/compiler:no_chromium_code" ] | 73 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 57 deps = [ | 74 deps = [ |
| 75 ":libwebp_headers", | |
| 58 ":libwebp_utils", | 76 ":libwebp_utils", |
| 59 ] | 77 ] |
| 60 } | 78 } |
| 61 | 79 |
| 62 static_library("libwebp_dsp") { | 80 static_library("libwebp_dsp") { |
| 63 sources = [ | 81 sources = [ |
| 64 "dsp/alpha_processing.c", | 82 "dsp/alpha_processing.c", |
| 65 "dsp/alpha_processing_mips_dsp_r2.c", | 83 "dsp/alpha_processing_mips_dsp_r2.c", |
| 66 "dsp/argb.c", | 84 "dsp/argb.c", |
| 67 "dsp/argb_mips_dsp_r2.c", | 85 "dsp/argb_mips_dsp_r2.c", |
| 86 "dsp/common_sse2.h", | |
| 68 "dsp/cost.c", | 87 "dsp/cost.c", |
| 69 "dsp/cost_mips32.c", | 88 "dsp/cost_mips32.c", |
| 70 "dsp/cost_mips_dsp_r2.c", | 89 "dsp/cost_mips_dsp_r2.c", |
| 71 "dsp/cpu.c", | 90 "dsp/cpu.c", |
| 72 "dsp/dec.c", | 91 "dsp/dec.c", |
| 73 "dsp/dec_clip_tables.c", | 92 "dsp/dec_clip_tables.c", |
| 74 "dsp/dec_mips32.c", | 93 "dsp/dec_mips32.c", |
| 75 "dsp/dec_mips_dsp_r2.c", | 94 "dsp/dec_mips_dsp_r2.c", |
| 76 "dsp/dec_msa.c", | 95 "dsp/dec_msa.c", |
| 96 "dsp/dsp.h", | |
| 77 "dsp/enc.c", | 97 "dsp/enc.c", |
| 78 "dsp/enc_avx2.c", | 98 "dsp/enc_avx2.c", |
| 79 "dsp/enc_mips32.c", | 99 "dsp/enc_mips32.c", |
| 80 "dsp/enc_mips_dsp_r2.c", | 100 "dsp/enc_mips_dsp_r2.c", |
| 81 "dsp/enc_msa.c", | 101 "dsp/enc_msa.c", |
| 82 "dsp/filters.c", | 102 "dsp/filters.c", |
| 83 "dsp/filters_mips_dsp_r2.c", | 103 "dsp/filters_mips_dsp_r2.c", |
| 84 "dsp/filters_msa.c", | 104 "dsp/filters_msa.c", |
| 85 "dsp/lossless.c", | 105 "dsp/lossless.c", |
| 106 "dsp/lossless.h", | |
| 107 "dsp/lossless_common.h", | |
| 86 "dsp/lossless_enc.c", | 108 "dsp/lossless_enc.c", |
| 87 "dsp/lossless_enc_mips32.c", | 109 "dsp/lossless_enc_mips32.c", |
| 88 "dsp/lossless_enc_mips_dsp_r2.c", | 110 "dsp/lossless_enc_mips_dsp_r2.c", |
| 89 "dsp/lossless_enc_msa.c", | 111 "dsp/lossless_enc_msa.c", |
| 90 "dsp/lossless_mips_dsp_r2.c", | 112 "dsp/lossless_mips_dsp_r2.c", |
| 91 "dsp/lossless_msa.c", | 113 "dsp/lossless_msa.c", |
| 114 "dsp/neon.h", | |
| 92 "dsp/rescaler.c", | 115 "dsp/rescaler.c", |
| 93 "dsp/rescaler_mips32.c", | 116 "dsp/rescaler_mips32.c", |
| 94 "dsp/rescaler_mips_dsp_r2.c", | 117 "dsp/rescaler_mips_dsp_r2.c", |
| 95 "dsp/rescaler_msa.c", | 118 "dsp/rescaler_msa.c", |
| 96 "dsp/upsampling.c", | 119 "dsp/upsampling.c", |
| 97 "dsp/upsampling_mips_dsp_r2.c", | 120 "dsp/upsampling_mips_dsp_r2.c", |
| 98 "dsp/upsampling_msa.c", | 121 "dsp/upsampling_msa.c", |
| 99 "dsp/yuv.c", | 122 "dsp/yuv.c", |
| 123 "dsp/yuv.h", | |
| 100 "dsp/yuv_mips32.c", | 124 "dsp/yuv_mips32.c", |
| 101 "dsp/yuv_mips_dsp_r2.c", | 125 "dsp/yuv_mips_dsp_r2.c", |
| 102 ] | 126 ] |
| 103 configs -= [ "//build/config/compiler:chromium_code" ] | 127 configs -= [ "//build/config/compiler:chromium_code" ] |
| 104 configs += [ "//build/config/compiler:no_chromium_code" ] | 128 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 105 if (set_opt_level) { | 129 if (set_opt_level) { |
| 106 configs -= [ "//build/config/compiler:default_optimization" ] | 130 configs -= [ "//build/config/compiler:default_optimization" ] |
| 107 configs += [ "//build/config/compiler:optimize_max" ] | 131 configs += [ "//build/config/compiler:optimize_max" ] |
| 108 } | 132 } |
| 109 | 133 |
| 110 all_dependent_configs = [ ":libwebp_config" ] | 134 all_dependent_configs = [ ":libwebp_config" ] |
| 111 deps = [ | 135 deps = [ |
| 112 ":libwebp_dsp_sse2", | 136 ":libwebp_dsp_sse2", |
| 113 ":libwebp_dsp_sse41", | 137 ":libwebp_dsp_sse41", |
| 138 ":libwebp_headers", | |
| 114 ":libwebp_utils", | 139 ":libwebp_utils", |
| 115 ] | 140 ] |
| 116 if (is_android) { | 141 if (is_android) { |
| 117 deps += [ "//third_party/android_tools:cpu_features" ] | 142 deps += [ "//third_party/android_tools:cpu_features" ] |
| 118 | 143 |
| 119 configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] | 144 configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] |
| 120 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] | 145 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] |
| 121 } | 146 } |
| 122 if (current_cpu == "x86" || current_cpu == "x64") { | 147 if (current_cpu == "x86" || current_cpu == "x64") { |
| 123 defines = [ | 148 defines = [ |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] | 239 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] |
| 215 } | 240 } |
| 216 } | 241 } |
| 217 } # use_dsp_neon | 242 } # use_dsp_neon |
| 218 | 243 |
| 219 static_library("libwebp_enc") { | 244 static_library("libwebp_enc") { |
| 220 sources = [ | 245 sources = [ |
| 221 "enc/alpha_enc.c", | 246 "enc/alpha_enc.c", |
| 222 "enc/analysis_enc.c", | 247 "enc/analysis_enc.c", |
| 223 "enc/backward_references_enc.c", | 248 "enc/backward_references_enc.c", |
| 249 "enc/backward_references_enc.h", | |
| 224 "enc/config_enc.c", | 250 "enc/config_enc.c", |
| 225 "enc/cost_enc.c", | 251 "enc/cost_enc.c", |
| 252 "enc/cost_enc.h", | |
| 226 "enc/delta_palettization_enc.c", | 253 "enc/delta_palettization_enc.c", |
| 254 "enc/delta_palettization_enc.h", | |
| 227 "enc/filter_enc.c", | 255 "enc/filter_enc.c", |
| 228 "enc/frame_enc.c", | 256 "enc/frame_enc.c", |
| 229 "enc/histogram_enc.c", | 257 "enc/histogram_enc.c", |
| 258 "enc/histogram_enc.h", | |
| 230 "enc/iterator_enc.c", | 259 "enc/iterator_enc.c", |
| 231 "enc/near_lossless_enc.c", | 260 "enc/near_lossless_enc.c", |
| 232 "enc/picture_csp_enc.c", | 261 "enc/picture_csp_enc.c", |
| 233 "enc/picture_enc.c", | 262 "enc/picture_enc.c", |
| 234 "enc/picture_psnr_enc.c", | 263 "enc/picture_psnr_enc.c", |
| 235 "enc/picture_rescale_enc.c", | 264 "enc/picture_rescale_enc.c", |
| 236 "enc/picture_tools_enc.c", | 265 "enc/picture_tools_enc.c", |
| 237 "enc/predictor_enc.c", | 266 "enc/predictor_enc.c", |
| 238 "enc/quant_enc.c", | 267 "enc/quant_enc.c", |
| 239 "enc/syntax_enc.c", | 268 "enc/syntax_enc.c", |
| 240 "enc/token_enc.c", | 269 "enc/token_enc.c", |
| 241 "enc/tree_enc.c", | 270 "enc/tree_enc.c", |
| 271 "enc/vp8i_enc.h", | |
| 242 "enc/vp8l_enc.c", | 272 "enc/vp8l_enc.c", |
| 273 "enc/vp8li_enc.h", | |
| 243 "enc/webp_enc.c", | 274 "enc/webp_enc.c", |
| 275 "webp/encode.h", | |
| 244 ] | 276 ] |
| 245 configs -= [ "//build/config/compiler:chromium_code" ] | 277 configs -= [ "//build/config/compiler:chromium_code" ] |
| 246 configs += [ "//build/config/compiler:no_chromium_code" ] | 278 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 247 if (set_opt_level) { | 279 if (set_opt_level) { |
| 248 configs -= [ "//build/config/compiler:default_optimization" ] | 280 configs -= [ "//build/config/compiler:default_optimization" ] |
| 249 configs += [ "//build/config/compiler:optimize_max" ] | 281 configs += [ "//build/config/compiler:optimize_max" ] |
| 250 } | 282 } |
| 251 | 283 |
| 252 all_dependent_configs = [ ":libwebp_config" ] | 284 all_dependent_configs = [ ":libwebp_config" ] |
| 253 | 285 |
| 254 deps = [ | 286 deps = [ |
| 287 ":libwebp_headers", | |
| 255 ":libwebp_utils", | 288 ":libwebp_utils", |
| 256 ] | 289 ] |
| 257 } | 290 } |
| 258 | 291 |
| 259 config("libwebp_utils_warnings") { | 292 config("libwebp_utils_warnings") { |
| 260 if (is_clang) { | 293 if (is_clang) { |
| 261 # See https://code.google.com/p/webp/issues/detail?id=253. | 294 # See https://code.google.com/p/webp/issues/detail?id=253. |
| 262 cflags = [ "-Wno-incompatible-pointer-types" ] | 295 cflags = [ "-Wno-incompatible-pointer-types" ] |
| 263 } | 296 } |
| 264 } | 297 } |
| 265 | 298 |
| 266 static_library("libwebp_utils") { | 299 static_library("libwebp_utils") { |
| 267 sources = [ | 300 sources = [ |
| 301 "utils/bit_reader_inl_utils.h", | |
| 268 "utils/bit_reader_utils.c", | 302 "utils/bit_reader_utils.c", |
| 303 "utils/bit_reader_utils.h", | |
| 269 "utils/bit_writer_utils.c", | 304 "utils/bit_writer_utils.c", |
| 305 "utils/bit_writer_utils.h", | |
| 270 "utils/color_cache_utils.c", | 306 "utils/color_cache_utils.c", |
| 307 "utils/color_cache_utils.h", | |
| 308 "utils/endian_inl_utils.h", | |
| 271 "utils/filters_utils.c", | 309 "utils/filters_utils.c", |
| 310 "utils/filters_utils.h", | |
| 272 "utils/huffman_encode_utils.c", | 311 "utils/huffman_encode_utils.c", |
| 312 "utils/huffman_encode_utils.h", | |
| 273 "utils/huffman_utils.c", | 313 "utils/huffman_utils.c", |
| 314 "utils/huffman_utils.h", | |
| 274 "utils/quant_levels_dec_utils.c", | 315 "utils/quant_levels_dec_utils.c", |
| 316 "utils/quant_levels_dec_utils.h", | |
| 275 "utils/quant_levels_utils.c", | 317 "utils/quant_levels_utils.c", |
| 318 "utils/quant_levels_utils.h", | |
| 276 "utils/random_utils.c", | 319 "utils/random_utils.c", |
| 320 "utils/random_utils.h", | |
| 277 "utils/rescaler_utils.c", | 321 "utils/rescaler_utils.c", |
| 322 "utils/rescaler_utils.h", | |
| 278 "utils/thread_utils.c", | 323 "utils/thread_utils.c", |
| 324 "utils/thread_utils.h", | |
| 279 "utils/utils.c", | 325 "utils/utils.c", |
| 326 "utils/utils.h", | |
| 280 ] | 327 ] |
| 281 configs -= [ "//build/config/compiler:chromium_code" ] | 328 configs -= [ "//build/config/compiler:chromium_code" ] |
| 282 configs += [ "//build/config/compiler:no_chromium_code" ] | 329 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 283 if (set_opt_level) { | 330 if (set_opt_level) { |
| 284 configs -= [ "//build/config/compiler:default_optimization" ] | 331 configs -= [ "//build/config/compiler:default_optimization" ] |
| 285 configs += [ "//build/config/compiler:optimize_max" ] | 332 configs += [ "//build/config/compiler:optimize_max" ] |
| 286 } | 333 } |
| 287 | 334 |
| 288 all_dependent_configs = [ ":libwebp_config" ] | 335 all_dependent_configs = [ ":libwebp_config" ] |
| 289 | 336 |
| 290 public_configs = [ ":libwebp_utils_warnings" ] | 337 public_configs = [ ":libwebp_utils_warnings" ] |
| 291 } | 338 } |
| 292 | 339 |
| 293 group("libwebp") { | 340 group("libwebp") { |
| 294 deps = [ | 341 deps = [ |
| 295 ":libwebp_dec", | 342 ":libwebp_dec", |
| 296 ":libwebp_demux", | 343 ":libwebp_demux", |
| 297 ":libwebp_dsp", | 344 ":libwebp_dsp", |
| 298 ":libwebp_enc", | 345 ":libwebp_enc", |
| 299 ":libwebp_utils", | 346 ":libwebp_utils", |
| 300 ] | 347 ] |
| 301 public_configs = [ ":libwebp_config" ] | 348 public_configs = [ ":libwebp_config" ] |
| 302 if (use_dsp_neon) { | 349 if (use_dsp_neon) { |
| 303 deps += [ ":libwebp_dsp_neon" ] | 350 deps += [ ":libwebp_dsp_neon" ] |
| 304 } | 351 } |
| 305 } | 352 } |
| OLD | NEW |