blob: f973f84fb70e412cf6f67713ee480ac09b14168c [file] [log] [blame]
[email protected]71eb1122014-05-06 04:25:261# 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
5if (is_android) {
6 import("//build/config/android/config.gni")
7}
8
abakalov62291e732016-08-11 00:56:019assert(!is_ios, "This is not used on iOS, don't drag it in unintentionally")
thakisf8f88bf2016-08-03 17:34:2510
abakalov62291e732016-08-11 00:56:0111declare_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]71eb1122014-05-06 04:25:2618}
19
abakalov62291e732016-08-11 00:56:0120config("system_libjpeg_config") {
21 libs = [ "jpeg" ]
22 defines = [ "USE_SYSTEM_LIBJPEG" ]
23}
24
25config("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.
32group("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]71eb1122014-05-06 04:25:2640 } else {
abakalov62291e732016-08-11 00:56:0141 public_deps = [
42 "//third_party/libjpeg:libjpeg",
43 ]
[email protected]71eb1122014-05-06 04:25:2644 }
45}