1# Copyright 2019 The ANGLE Project 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# See: 6# https://chromium.googlesource.com/chromium/src/+/master/third_party/BUILD.gn 7 8import("//third_party/libjpeg.gni") 9 10assert(!is_ios, "This is not used on iOS, don't drag it in unintentionally") 11 12config("system_libjpeg_config") { 13 libs = [ "jpeg" ] 14 defines = [ "USE_SYSTEM_LIBJPEG" ] 15} 16 17config("libjpeg_turbo_config") { 18 defines = [ "USE_LIBJPEG_TURBO=1" ] 19} 20 21# This is a meta target that forwards to the system's libjpeg, 22# third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args 23# declared in this file. 24group("jpeg") { 25 if (use_system_libjpeg) { 26 public_configs = [ ":system_libjpeg_config" ] 27 } else if (use_libjpeg_turbo) { 28 public_deps = [ "//third_party/libjpeg_turbo:libjpeg" ] 29 public_configs = [ ":libjpeg_turbo_config" ] 30 } else { 31 public_deps = [ "//third_party/libjpeg:libjpeg" ] 32 } 33} 34 35# This is a meta target that forwards include paths only to the system's 36# libjpeg, third_party/libjpeg, or third_party/libjpeg_turbo depending on the 37# build args declared in this file. This is needed, rarely, for targets that 38# need to reference libjpeg without explicitly building it. 39group("jpeg_includes") { 40 if (use_system_libjpeg) { 41 public_configs = [ ":system_libjpeg_config" ] 42 } else if (use_libjpeg_turbo) { 43 public_configs = [ "//third_party/libjpeg_turbo:libjpeg_config" ] 44 } else { 45 public_configs = [ "//third_party/libjpeg:libjpeg_config" ] 46 } 47} 48