[email protected] | 71eb112 | 2014-05-06 04:25:26 | [diff] [blame] | 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 | if (is_android) { |
| 6 | import("//build/config/android/config.gni") |
| 7 | } |
| 8 | |
abakalov | 62291e73 | 2016-08-11 00:56:01 | [diff] [blame] | 9 | assert(!is_ios, "This is not used on iOS, don't drag it in unintentionally") |
thakis | f8f88bf | 2016-08-03 17:34:25 | [diff] [blame] | 10 | |
abakalov | 62291e73 | 2016-08-11 00:56:01 | [diff] [blame] | 11 | declare_args() { |
| 12 | # Uses system libjpeg. If true, overrides use_libjpeg_turbo. |
| 13 | use_system_libjpeg = false |
| 14 | |
| 15 | # Uses libjpeg_turbo as the jpeg implementation. Has no effect if |
| 16 | # use_system_libjpeg is set. |
| 17 | use_libjpeg_turbo = true |
[email protected] | 71eb112 | 2014-05-06 04:25:26 | [diff] [blame] | 18 | } |
| 19 | |
abakalov | 62291e73 | 2016-08-11 00:56:01 | [diff] [blame] | 20 | config("system_libjpeg_config") { |
| 21 | libs = [ "jpeg" ] |
| 22 | defines = [ "USE_SYSTEM_LIBJPEG" ] |
| 23 | } |
| 24 | |
| 25 | config("libjpeg_turbo_config") { |
| 26 | defines = [ "USE_LIBJPEG_TURBO=1" ] |
| 27 | } |
| 28 | |
| 29 | # This is a meta target that forwards to the system's libjpeg, |
| 30 | # third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args |
| 31 | # declared in this file. |
| 32 | group("jpeg") { |
| 33 | if (use_system_libjpeg) { |
| 34 | public_configs = [ ":system_libjpeg_config" ] |
| 35 | } else if (use_libjpeg_turbo) { |
| 36 | public_deps = [ |
| 37 | "//third_party/libjpeg_turbo:libjpeg", |
| 38 | ] |
| 39 | public_configs = [ ":libjpeg_turbo_config" ] |
[email protected] | 71eb112 | 2014-05-06 04:25:26 | [diff] [blame] | 40 | } else { |
abakalov | 62291e73 | 2016-08-11 00:56:01 | [diff] [blame] | 41 | public_deps = [ |
| 42 | "//third_party/libjpeg:libjpeg", |
| 43 | ] |
[email protected] | 71eb112 | 2014-05-06 04:25:26 | [diff] [blame] | 44 | } |
| 45 | } |