• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6declare_args() {
7  skia_use_system_libjpeg_turbo = is_official_build
8}
9
10import("../third_party.gni")
11
12if (skia_use_system_libjpeg_turbo) {
13  system("libjpeg") {
14    libs = [ "jpeg" ]
15  }
16} else {
17  third_party("libjpeg") {
18    public_include_dirs = [
19      ".",
20      "../externals/libjpeg-turbo",
21    ]
22
23    defines = [ "TURBO_FOR_WINDOWS" ]
24
25    sources = [
26      "../externals/libjpeg-turbo/jaricom.c",
27      "../externals/libjpeg-turbo/jcapimin.c",
28      "../externals/libjpeg-turbo/jcapistd.c",
29      "../externals/libjpeg-turbo/jcarith.c",
30      "../externals/libjpeg-turbo/jccoefct.c",
31      "../externals/libjpeg-turbo/jccolor.c",
32      "../externals/libjpeg-turbo/jcdctmgr.c",
33      "../externals/libjpeg-turbo/jchuff.c",
34      "../externals/libjpeg-turbo/jcinit.c",
35      "../externals/libjpeg-turbo/jcmainct.c",
36      "../externals/libjpeg-turbo/jcmarker.c",
37      "../externals/libjpeg-turbo/jcmaster.c",
38      "../externals/libjpeg-turbo/jcomapi.c",
39      "../externals/libjpeg-turbo/jcparam.c",
40      "../externals/libjpeg-turbo/jcphuff.c",
41      "../externals/libjpeg-turbo/jcprepct.c",
42      "../externals/libjpeg-turbo/jcsample.c",
43      "../externals/libjpeg-turbo/jdapimin.c",
44      "../externals/libjpeg-turbo/jdapistd.c",
45      "../externals/libjpeg-turbo/jdarith.c",
46      "../externals/libjpeg-turbo/jdcoefct.c",
47      "../externals/libjpeg-turbo/jdcolor.c",
48      "../externals/libjpeg-turbo/jddctmgr.c",
49      "../externals/libjpeg-turbo/jdhuff.c",
50      "../externals/libjpeg-turbo/jdinput.c",
51      "../externals/libjpeg-turbo/jdmainct.c",
52      "../externals/libjpeg-turbo/jdmarker.c",
53      "../externals/libjpeg-turbo/jdmaster.c",
54      "../externals/libjpeg-turbo/jdmerge.c",
55      "../externals/libjpeg-turbo/jdphuff.c",
56      "../externals/libjpeg-turbo/jdpostct.c",
57      "../externals/libjpeg-turbo/jdsample.c",
58      "../externals/libjpeg-turbo/jerror.c",
59      "../externals/libjpeg-turbo/jfdctflt.c",
60      "../externals/libjpeg-turbo/jfdctfst.c",
61      "../externals/libjpeg-turbo/jfdctint.c",
62      "../externals/libjpeg-turbo/jidctflt.c",
63      "../externals/libjpeg-turbo/jidctfst.c",
64      "../externals/libjpeg-turbo/jidctint.c",
65      "../externals/libjpeg-turbo/jidctred.c",
66      "../externals/libjpeg-turbo/jmemmgr.c",
67      "../externals/libjpeg-turbo/jmemnobs.c",
68      "../externals/libjpeg-turbo/jquant1.c",
69      "../externals/libjpeg-turbo/jquant2.c",
70      "../externals/libjpeg-turbo/jutils.c",
71    ]
72
73    if (current_cpu == "arm" && !is_ios && !is_win) {
74      sources += [
75        "../externals/libjpeg-turbo/simd/arm/jsimd.c",
76        "../externals/libjpeg-turbo/simd/arm/jsimd_neon.S",
77      ]
78    } else if (current_cpu == "arm64" && !is_ios && !is_win) {
79      sources += [
80        "../externals/libjpeg-turbo/simd/arm64/jsimd.c",
81        "../externals/libjpeg-turbo/simd/arm64/jsimd_neon.S",
82      ]
83    } else {
84      sources += [ "../externals/libjpeg-turbo/jsimd_none.c" ]
85    }
86  }
87}
88