blob: 37b589d35087d165b142edc2c4d576c719226d9c [file] [log] [blame]
mtklein7d10b9f2016-07-27 11:17:18 -07001# 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
6declare_args() {
Mike Kleine459afd2017-03-03 09:21:30 -05007 skia_use_system_libjpeg_turbo = is_official_build
mtklein7d10b9f2016-07-27 11:17:18 -07008}
9
10import("../third_party.gni")
11
Mike Klein10d665d2016-11-01 11:46:10 -040012if (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" ]
mtklein7d10b9f2016-07-27 11:17:18 -070019
Mike Klein10d665d2016-11-01 11:46:10 -040020 defines = [ "TURBO_FOR_WINDOWS" ]
mtklein7a1f45f2016-08-04 06:19:33 -070021
Mike Klein10d665d2016-11-01 11:46:10 -040022 sources = [
Matt Sarett9119de62017-02-10 17:47:51 -050023 "../externals/libjpeg-turbo/jaricom.c",
Mike Klein10d665d2016-11-01 11:46:10 -040024 "../externals/libjpeg-turbo/jcapimin.c",
25 "../externals/libjpeg-turbo/jcapistd.c",
Matt Sarett9119de62017-02-10 17:47:51 -050026 "../externals/libjpeg-turbo/jcarith.c",
Mike Klein10d665d2016-11-01 11:46:10 -040027 "../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 Sarett9119de62017-02-10 17:47:51 -050042 "../externals/libjpeg-turbo/jdarith.c",
Mike Klein10d665d2016-11-01 11:46:10 -040043 "../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 Klein10d665d2016-11-01 11:46:10 -040067 "../externals/libjpeg-turbo/jutils.c",
68 ]
Mike Kleine7bd81d2016-11-13 08:52:07 -050069
Mike Klein4fea6632016-11-14 09:16:32 -050070 if (current_cpu == "arm" && current_os != "ios") {
Mike Kleine7bd81d2016-11-13 08:52:07 -050071 sources += [
72 "../externals/libjpeg-turbo/simd/jsimd_arm.c",
73 "../externals/libjpeg-turbo/simd/jsimd_arm_neon.S",
74 ]
Mike Klein4fea6632016-11-14 09:16:32 -050075 } else if (current_cpu == "arm64" && current_os != "ios") {
Mike Kleine7bd81d2016-11-13 08:52:07 -050076 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 Klein10d665d2016-11-01 11:46:10 -040083 }
mtklein7d10b9f2016-07-27 11:17:18 -070084}