mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 1 | # Copyright 2016 Google Inc. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | declare_args() { |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame^] | 7 | skia_use_system_libjpeg_turbo = is_official_build |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 8 | } |
| 9 | |
| 10 | import("../third_party.gni") |
| 11 | |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 12 | if (skia_use_system_libjpeg_turbo) { |
| 13 | system("libjpeg") { |
| 14 | libs = [ "jpeg" ] |
| 15 | } |
| 16 | } else { |
| 17 | third_party("libjpeg") { |
| 18 | public_include_dirs = [ "../externals/libjpeg-turbo" ] |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 19 | |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 20 | defines = [ "TURBO_FOR_WINDOWS" ] |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 21 | |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 22 | sources = [ |
Matt Sarett | 9119de6 | 2017-02-10 17:47:51 -0500 | [diff] [blame] | 23 | "../externals/libjpeg-turbo/jaricom.c", |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 24 | "../externals/libjpeg-turbo/jcapimin.c", |
| 25 | "../externals/libjpeg-turbo/jcapistd.c", |
Matt Sarett | 9119de6 | 2017-02-10 17:47:51 -0500 | [diff] [blame] | 26 | "../externals/libjpeg-turbo/jcarith.c", |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 27 | "../externals/libjpeg-turbo/jccoefct.c", |
| 28 | "../externals/libjpeg-turbo/jccolor.c", |
| 29 | "../externals/libjpeg-turbo/jcdctmgr.c", |
| 30 | "../externals/libjpeg-turbo/jchuff.c", |
| 31 | "../externals/libjpeg-turbo/jcinit.c", |
| 32 | "../externals/libjpeg-turbo/jcmainct.c", |
| 33 | "../externals/libjpeg-turbo/jcmarker.c", |
| 34 | "../externals/libjpeg-turbo/jcmaster.c", |
| 35 | "../externals/libjpeg-turbo/jcomapi.c", |
| 36 | "../externals/libjpeg-turbo/jcparam.c", |
| 37 | "../externals/libjpeg-turbo/jcphuff.c", |
| 38 | "../externals/libjpeg-turbo/jcprepct.c", |
| 39 | "../externals/libjpeg-turbo/jcsample.c", |
| 40 | "../externals/libjpeg-turbo/jdapimin.c", |
| 41 | "../externals/libjpeg-turbo/jdapistd.c", |
Matt Sarett | 9119de6 | 2017-02-10 17:47:51 -0500 | [diff] [blame] | 42 | "../externals/libjpeg-turbo/jdarith.c", |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 43 | "../externals/libjpeg-turbo/jdcoefct.c", |
| 44 | "../externals/libjpeg-turbo/jdcolor.c", |
| 45 | "../externals/libjpeg-turbo/jddctmgr.c", |
| 46 | "../externals/libjpeg-turbo/jdhuff.c", |
| 47 | "../externals/libjpeg-turbo/jdinput.c", |
| 48 | "../externals/libjpeg-turbo/jdmainct.c", |
| 49 | "../externals/libjpeg-turbo/jdmarker.c", |
| 50 | "../externals/libjpeg-turbo/jdmaster.c", |
| 51 | "../externals/libjpeg-turbo/jdmerge.c", |
| 52 | "../externals/libjpeg-turbo/jdphuff.c", |
| 53 | "../externals/libjpeg-turbo/jdpostct.c", |
| 54 | "../externals/libjpeg-turbo/jdsample.c", |
| 55 | "../externals/libjpeg-turbo/jerror.c", |
| 56 | "../externals/libjpeg-turbo/jfdctflt.c", |
| 57 | "../externals/libjpeg-turbo/jfdctfst.c", |
| 58 | "../externals/libjpeg-turbo/jfdctint.c", |
| 59 | "../externals/libjpeg-turbo/jidctflt.c", |
| 60 | "../externals/libjpeg-turbo/jidctfst.c", |
| 61 | "../externals/libjpeg-turbo/jidctint.c", |
| 62 | "../externals/libjpeg-turbo/jidctred.c", |
| 63 | "../externals/libjpeg-turbo/jmemmgr.c", |
| 64 | "../externals/libjpeg-turbo/jmemnobs.c", |
| 65 | "../externals/libjpeg-turbo/jquant1.c", |
| 66 | "../externals/libjpeg-turbo/jquant2.c", |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 67 | "../externals/libjpeg-turbo/jutils.c", |
| 68 | ] |
Mike Klein | e7bd81d | 2016-11-13 08:52:07 -0500 | [diff] [blame] | 69 | |
Mike Klein | 4fea663 | 2016-11-14 09:16:32 -0500 | [diff] [blame] | 70 | if (current_cpu == "arm" && current_os != "ios") { |
Mike Klein | e7bd81d | 2016-11-13 08:52:07 -0500 | [diff] [blame] | 71 | sources += [ |
| 72 | "../externals/libjpeg-turbo/simd/jsimd_arm.c", |
| 73 | "../externals/libjpeg-turbo/simd/jsimd_arm_neon.S", |
| 74 | ] |
Mike Klein | 4fea663 | 2016-11-14 09:16:32 -0500 | [diff] [blame] | 75 | } else if (current_cpu == "arm64" && current_os != "ios") { |
Mike Klein | e7bd81d | 2016-11-13 08:52:07 -0500 | [diff] [blame] | 76 | sources += [ |
| 77 | "../externals/libjpeg-turbo/simd/jsimd_arm64.c", |
| 78 | "../externals/libjpeg-turbo/simd/jsimd_arm64_neon.S", |
| 79 | ] |
| 80 | } else { |
| 81 | sources += [ "../externals/libjpeg-turbo/jsimd_none.c" ] |
| 82 | } |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 83 | } |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 84 | } |