Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: platform_tools/android/bin/android_framework_gyp.py

Issue 140503007: Scripts to generate Android.mk for framework Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Respond to comments in patch set 5. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/python
2
3 # Copyright 2014 Google Inc.
4 #
5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file.
7
8 """
9 Modified version of gyp_skia, used by gyp_to_android.py to generate Android.mk
10 """
11
12 import os
13 import sys
14
15 script_dir = os.path.dirname(__file__)
16
17 # Unlike gyp_skia, this file is nested deep inside Skia. Move to Skia trunk.
epoger 2014/01/23 18:57:58 I'm not sure what you mean by "Move to Skia trunk"
scroggo 2014/01/24 20:09:02 Done.
18 # This line depends on the fact that the script is three levels deep
19 # (specifically, it is in platform_tools/android/bin).
20 skia_dir = os.path.normpath(os.path.join(script_dir, os.pardir, os.pardir,
21 os.pardir))
22 dir_contents = os.listdir(skia_dir)
23 assert 'third_party' in dir_contents and 'gyp' in dir_contents
24
25 # Directory within which we can find the gyp source.
26 gyp_source_dir = os.path.join(skia_dir, 'third_party', 'externals', 'gyp')
27
28 # Directory within which we can find most of Skia's gyp configuration files.
29 gyp_config_dir = os.path.join(skia_dir, 'gyp')
30
31 # Ensure we import our current gyp source's module, not any version
32 # pre-installed in your PYTHONPATH.
33 sys.path.insert(0, os.path.join(gyp_source_dir, 'pylib'))
34
35 import gyp
36
37 def main(skia_arch_type, have_neon):
38 # Set GYP_DEFINES for building for the android framework.
39 gyp_defines = ('skia_android_framework=1 OS=android skia_arch_type=%s '
40 % skia_arch_type)
41 if skia_arch_type == 'arm':
42 # Always use thumb and version 7 for arm
43 gyp_defines = gyp_defines + 'arm_thumb=1 arm_version=7 '
epoger 2014/01/23 18:57:58 You can use x += y instead of x = x + y
scroggo 2014/01/24 20:09:02 Done.
44 if have_neon:
45 gyp_defines = gyp_defines + 'arm_neon=1 '
46 else:
47 gyp_defines = gyp_defines + 'arm_neon=0 '
48
49 os.environ['GYP_DEFINES'] = gyp_defines
50
51 args = []
52 args.extend(['--depth', '.'])
53 # Use the android_framework_lib file instead of skia.gyp
54 args.extend([os.path.join(gyp_config_dir, 'android_framework_lib.gyp')])
55 # Common conditions
56 args.extend(['-I', 'gyp/common.gypi'])
57 # Use the debugging format. We'll use these to create one master make file.
58 args.extend(['-f', 'gypd'])
59
60 # Off we go...
61 return gyp.main(args)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698