blob: 1876f0a8b71c4c541e29c8fd918ef44997259fe0 [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
9declare_args() {
10 # Uses system libjpeg. If true, overrides use_libjpeg_turbo.
torne7c8c58062014-09-07 12:40:4111 use_system_libjpeg = false
[email protected]71eb1122014-05-06 04:25:2612
13 # Uses libjpeg_turbo as the jpeg implementation. Has no effect if
14 # use_system_libjpeg is set.
15 use_libjpeg_turbo = true
16}
17
18config("system_libjpeg_config") {
19 defines = [ "USE_SYSTEM_LIBJPEG" ]
20}
21
22config("libjpeg_turbo_config") {
brettw9f7a2cb2015-05-12 05:36:2823 defines = [ "USE_LIBJPEG_TURBO=1" ]
[email protected]71eb1122014-05-06 04:25:2624}
25
26# This is a meta target that forwards to the system's libjpeg,
27# third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args
28# declared in this file.
29group("jpeg") {
30 if (use_system_libjpeg) {
31 libs = [ "jpeg" ]
Brett Wilsone53895272014-09-23 23:41:4632 public_configs = [ ":system_libjpeg_config" ]
[email protected]71eb1122014-05-06 04:25:2633 } else if (use_libjpeg_turbo) {
scottmg1c240d272014-12-03 07:28:0034 deps = [
35 "//third_party/libjpeg_turbo:libjpeg",
36 ]
Brett Wilsone53895272014-09-23 23:41:4637 public_configs = [ ":libjpeg_turbo_config" ]
[email protected]71eb1122014-05-06 04:25:2638 } else {
scottmg1c240d272014-12-03 07:28:0039 deps = [
40 "//third_party/libjpeg:libjpeg",
41 ]
[email protected]71eb1122014-05-06 04:25:2642 }
43}