aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/gyp/dependencies.gypi
blob: 036abf2cc5422b2e16b4a52b530a0d34a1145e1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This GYP file stores the dependencies necessary to build Skia on the Android
# platform. The OS doesn't provide many stable libraries as part of the
# distribution so we have to build a few of them ourselves.
#
# NOTE: We tried adding the gyp file to the android/ directory at the root of
# the Skia repo, but that resulted in the generated makefiles being created
# outside of the out directory. We may be able to move the bulk of this gyp
# to the /android directory and put a simple shim here, but that has yet to be
# tested.

{
  'variables': {
    'skia_warnings_as_errors': 0,
  },
  'targets': [
    {
      'target_name': 'native_app_glue',
      'type': 'static_library',
      'direct_dependent_settings': {
        'include_dirs': [
          '../third_party/native_app_glue',
        ],
      },
      'sources': [
        '../third_party/native_app_glue/android_native_app_glue.c',
        '../third_party/native_app_glue/android_native_app_glue.h',
      ],
      'cflags': [
        '-w',
      ],
    }, 
    {
      'target_name': 'cpu_features',
      'type': 'static_library',
      'direct_dependent_settings': {
        'include_dirs': [
          '../third_party/cpufeatures',
        ],
      },
      'sources': [
        '../third_party/cpufeatures/cpu-features.c',
        '../third_party/cpufeatures/cpu-features.h',
      ],
      'cflags': [
        '-w',
      ],
    },
    {
      'target_name': 'ashmem',
      'type': 'static_library',
      'sources': [
        '../third_party/ashmem/cutils/ashmem.h',
        '../third_party/ashmem/cutils/ashmem-dev.c'
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '../third_party/ashmem',
        ]
      },
    },
    {
      'target_name': 'expat',
      'type': 'static_library',
      'sources': [
        '../third_party/externals/expat/lib/xmlparse.c',
        '../third_party/externals/expat/lib/xmlrole.c',
        '../third_party/externals/expat/lib/xmltok.c',
      ],
      'include_dirs': [
        '../third_party/externals/expat',
        '../third_party/externals/expat/lib',
      ],
      'cflags': [
        '-w',
        '-fexceptions',
      ],
      'defines': [
        'HAVE_EXPAT_CONFIG_H',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '../third_party/externals/expat/lib',  # For expat.h
        ],
      }
    },
    {
      'target_name': 'png',
      'type': 'static_library',
      'sources': [
        '../third_party/externals/png/png.c',
        '../third_party/externals/png/pngerror.c',
        '../third_party/externals/png/pnggccrd.c',
        '../third_party/externals/png/pngget.c',
        '../third_party/externals/png/pngmem.c',
        '../third_party/externals/png/pngpread.c',
        '../third_party/externals/png/pngread.c',
        '../third_party/externals/png/pngrio.c',
        '../third_party/externals/png/pngrtran.c',
        '../third_party/externals/png/pngrutil.c',
        '../third_party/externals/png/pngset.c',
        '../third_party/externals/png/pngtrans.c',
        '../third_party/externals/png/pngvcrd.c',
        '../third_party/externals/png/pngwio.c',
        '../third_party/externals/png/pngwrite.c',
        '../third_party/externals/png/pngwtran.c',
        '../third_party/externals/png/pngwutil.c',
      ],
      'include_dirs': [
        '../third_party/externals/png',
      ],
      'cflags': [
        '-w',
        '-fvisibility=hidden',
      ],
      'link_settings': {
        'libraries': [
          '-lz',
        ],
      },
      'direct_dependent_settings': {
        'include_dirs': [
          '../third_party/externals/png',
        ],
      }
    },
    {
      'target_name': 'jpeg',
      'type': 'static_library',
      'dependencies': [
        'ashmem'
      ],
      'sources': [
        '../third_party/externals/jpeg/jcapimin.c',
        '../third_party/externals/jpeg/jcapistd.c',
        '../third_party/externals/jpeg/jccoefct.c',
        '../third_party/externals/jpeg/jccolor.c',
        '../third_party/externals/jpeg/jcdctmgr.c',
        '../third_party/externals/jpeg/jchuff.c',
        '../third_party/externals/jpeg/jcinit.c',
        '../third_party/externals/jpeg/jcmainct.c',
        '../third_party/externals/jpeg/jcmarker.c',
        '../third_party/externals/jpeg/jcmaster.c',
        '../third_party/externals/jpeg/jcomapi.c',
        '../third_party/externals/jpeg/jcparam.c',
        '../third_party/externals/jpeg/jcphuff.c',
        '../third_party/externals/jpeg/jcprepct.c',
        '../third_party/externals/jpeg/jcsample.c',
        '../third_party/externals/jpeg/jctrans.c',
        '../third_party/externals/jpeg/jdapimin.c',
        '../third_party/externals/jpeg/jdapistd.c',
        '../third_party/externals/jpeg/jdatadst.c',
        '../third_party/externals/jpeg/jdatasrc.c',
        '../third_party/externals/jpeg/jdcoefct.c',
        '../third_party/externals/jpeg/jdcolor.c',
        '../third_party/externals/jpeg/jddctmgr.c',
        '../third_party/externals/jpeg/jdhuff.c',
        '../third_party/externals/jpeg/jdinput.c',
        '../third_party/externals/jpeg/jdmainct.c',
        '../third_party/externals/jpeg/jdmarker.c',
        '../third_party/externals/jpeg/jdmaster.c',
        '../third_party/externals/jpeg/jdmerge.c',
        '../third_party/externals/jpeg/jdphuff.c',
        '../third_party/externals/jpeg/jdpostct.c',
        '../third_party/externals/jpeg/jdsample.c',
        '../third_party/externals/jpeg/jdtrans.c',
        '../third_party/externals/jpeg/jerror.c',
        '../third_party/externals/jpeg/jfdctflt.c',
        '../third_party/externals/jpeg/jfdctfst.c',
        '../third_party/externals/jpeg/jfdctint.c',
        '../third_party/externals/jpeg/jidctflt.c',
        '../third_party/externals/jpeg/jidctfst.c',
        '../third_party/externals/jpeg/jidctint.c',
        '../third_party/externals/jpeg/jidctred.c',
        '../third_party/externals/jpeg/jmem-ashmem.c',
        '../third_party/externals/jpeg/jmemmgr.c',
        '../third_party/externals/jpeg/jquant1.c',
        '../third_party/externals/jpeg/jquant2.c',
        '../third_party/externals/jpeg/jutils.c',
      ],
      'conditions': [
        [ 'arm_neon == 1 and skia_clang_build == 0',
          {
            'sources' : [
              '../third_party/externals/jpeg/armv6_idct.S',
              '../third_party/externals/jpeg/jsimd_arm_neon.S',
              '../third_party/externals/jpeg/jsimd_neon.c',
            ],
            'defines' : [
              'NV_ARM_NEON',
            ],
          },
        ],
        [ 'skia_arch_type == "mips" and mips_dsp == 2',
          {
            'sources' : [
              '../third_party/externals/jpeg/mips_jidctfst.c',
              '../third_party/externals/jpeg/mips_idct_le.S',
            ],
            'defines' : [
              'ANDROID_MIPS_IDCT',
            ],
          },
        ],
        [ '"x86" in skia_arch_type',
          {
            'sources' : [
              '../third_party/externals/jpeg/jidctintelsse.c',
            ],
            'defines' : [
              'ANDROID_INTELSSE2_IDCT',
            ],
          },
        ],
      ],
      'include_dirs': [
        '../third_party/externals/jpeg',
      ],
      'cflags': [
        '-w',
        '-fvisibility=hidden',
        '-DAVOID_TABLES',
        '-DUSE_ANDROID_ASHMEM',
        '-O3',
        '-fstrict-aliasing',
        '-fprefetch-loop-arrays',
        '-DANDROID_TILE_BASED_DECODE',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '../third_party/externals/jpeg',
        ],
      }
    },
    {
      # This target is a dependency for all console-type Skia applications which
      # will run on Android.  Since Android requires us to load native code in
      # shared libraries, we need a common entry point to wrap around main().
      # Here we also change the type of all would-be executables to be shared
      # libraries.  The alternative would be to introduce a condition in every
      # executable target which changes to a shared library if the target OS is
      # Android.  This is nicer because the switch is in one place.
      'target_name': 'Android_EntryPoint',
      'type': 'static_library',
      'direct_dependent_settings': {
        'target_conditions': [
          # '_type' is an 'automatic variable' which is defined for any
          # target which defines a key-value pair with 'type' as the key (so,
          # all of them).  Conditionals inside 'target_conditions' are evaluated
          # *after* all other definitions and conditionals are evaluated, so
          # we're guaranteed that '_type' will be defined when we get here.
          # For more info, see:
          # - http://code.google.com/p/gyp/wiki/InputFormatReference#Variables
          # - http://codereview.appspot.com/6353065/
          ['_type == "executable"', {
            'type': 'shared_library',
          }],
        ],
      },
    },
    {
      # This target is a dependency for Skia Sample application which runs on
      # Android.  Since Android requires us to load native code in shared
      # libraries, we need a common entry point to wrap around main(). Here
      # we also change the type of all would-be executables to be shared
      # libraries.  The alternative would be to introduce a condition in every
      # executable target which changes to a shared library if the target OS is
      # Android.  This is nicer because the switch is in one place.
      'target_name': 'Android_SampleApp',
      'type': 'static_library',
      'direct_dependent_settings': {
        'target_conditions': [
          # '_type' is an 'automatic variable' which is defined for any
          # target which defines a key-value pair with 'type' as the key (so,
          # all of them).  Conditionals inside 'target_conditions' are evaluated
          # *after* all other definitions and conditionals are evaluated, so
          # we're guaranteed that '_type' will be defined when we get here.
          # For more info, see:
          # - http://code.google.com/p/gyp/wiki/InputFormatReference#Variables
          # - http://codereview.appspot.com/6353065/
          ['_type == "executable"', {
            'type': 'shared_library',
          }],
        ],
        'sources': [
          '../apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp',
        ],
      },
    },
    {
      # This target is a dependency for VisualBench application which runs on
      # Android.  Since Android requires us to load native code in shared
      # libraries, we need a common entry point to wrap around main(). Here
      # we also change the type of all would-be executables to be shared
      # libraries.  The alternative would be to introduce a condition in every
      # executable target which changes to a shared library if the target OS is
      # Android.  This is nicer because the switch is in one place.
      'target_name': 'Android_VisualBench',
      'type': 'static_library',
      'direct_dependent_settings': {
        'target_conditions': [
          # '_type' is an 'automatic variable' which is defined for any
          # target which defines a key-value pair with 'type' as the key (so,
          # all of them).  Conditionals inside 'target_conditions' are evaluated
          # *after* all other definitions and conditionals are evaluated, so
          # we're guaranteed that '_type' will be defined when we get here.
          # For more info, see:
          # - http://code.google.com/p/gyp/wiki/InputFormatReference#Variables
          # - http://codereview.appspot.com/6353065/
          ['_type == "executable"', {
            'type': 'shared_library',
          }],
        ],
        'include_dirs': [
          '../../../tools/timer/',
          '../../../tools/VisualBench/',
        ],
        'sources': [
          '../apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp',
          '../apps/visualbench/src/main/jni/main.cpp',
        ],
      },
    },
  ]
}