OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright 2014 Google Inc. | 3 # Copyright 2014 Google Inc. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 """ | 8 """ |
9 Modified version of gyp_skia, used by gyp_to_android.py to generate Android.mk | 9 Modified version of gyp_skia, used by gyp_to_android.py to generate Android.mk |
10 """ | 10 """ |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 print 'gyp_source_dir is "%s"' % gyp_source_dir | 52 print 'gyp_source_dir is "%s"' % gyp_source_dir |
53 if not os.path.exists(gyp_source_dir): | 53 if not os.path.exists(gyp_source_dir): |
54 print 'and it does not exist!' | 54 print 'and it does not exist!' |
55 | 55 |
56 assert os.path.exists(gyp_source_dir) | 56 assert os.path.exists(gyp_source_dir) |
57 | 57 |
58 sys.path.insert(0, os.path.join(gyp_source_dir, 'pylib')) | 58 sys.path.insert(0, os.path.join(gyp_source_dir, 'pylib')) |
59 | 59 |
60 import gyp | 60 import gyp |
61 | 61 |
62 # Determine the host that we are building from | |
63 host_os = os.uname()[0].lower() | |
msarett
2015/07/22 14:27:41
Maybe it doesn't need to be this complicated and h
| |
64 | |
62 # Set GYP_DEFINES for building for the android framework. | 65 # Set GYP_DEFINES for building for the android framework. |
63 gyp_defines = ('skia_android_framework=1 OS=android skia_arch_type=%s ' | 66 gyp_defines = ('skia_android_framework=1 OS=android host_os=%s ' |
64 % skia_arch_type) | 67 'skia_arch_type=%s ' % (host_os, skia_arch_type)) |
65 if skia_arch_type == 'arm': | 68 if skia_arch_type == 'arm': |
66 # Always version 7 (which implies thumb) for arm | 69 # Always version 7 (which implies thumb) for arm |
67 gyp_defines += 'arm_version=7 ' | 70 gyp_defines += 'arm_version=7 ' |
68 if have_neon: | 71 if have_neon: |
69 gyp_defines += 'arm_neon=1 ' | 72 gyp_defines += 'arm_neon=1 ' |
70 else: | 73 else: |
71 gyp_defines += 'arm_neon=0 ' | 74 gyp_defines += 'arm_neon=0 ' |
72 | 75 |
73 os.environ['GYP_DEFINES'] = gyp_defines | 76 os.environ['GYP_DEFINES'] = gyp_defines |
74 | 77 |
(...skipping 25 matching lines...) Expand all Loading... | |
100 """Remove the gypd files generated by main(). | 103 """Remove the gypd files generated by main(). |
101 | 104 |
102 Args: | 105 Args: |
103 folder: Folder in which to delete all files ending with 'gypd'. | 106 folder: Folder in which to delete all files ending with 'gypd'. |
104 """ | 107 """ |
105 assert os.path.isdir(folder) | 108 assert os.path.isdir(folder) |
106 files = os.listdir(folder) | 109 files = os.listdir(folder) |
107 for f in files: | 110 for f in files: |
108 if f.endswith('gypd'): | 111 if f.endswith('gypd'): |
109 os.remove(os.path.join(folder, f)) | 112 os.remove(os.path.join(folder, f)) |
OLD | NEW |