OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright 2011 The Android Open Source Project | 3 # Copyright 2011 The Android Open Source Project |
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 # This script is a wrapper which invokes gyp with the correct --depth argument, | 8 # This script is a wrapper which invokes gyp with the correct --depth argument, |
9 # and supports the automatic regeneration of build files if all.gyp is | 9 # and supports the automatic regeneration of build files if all.gyp is |
10 # changed (Linux-only). | 10 # changed (Linux-only). |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return os.path.join(os.path.abspath(script_dir), output_dir) | 77 return os.path.join(os.path.abspath(script_dir), output_dir) |
78 | 78 |
79 | 79 |
80 if __name__ == '__main__': | 80 if __name__ == '__main__': |
81 args = sys.argv[1:] | 81 args = sys.argv[1:] |
82 | 82 |
83 if not os.getenv(ENVVAR_GYP_GENERATORS): | 83 if not os.getenv(ENVVAR_GYP_GENERATORS): |
84 print ('%s environment variable not set, using default' % | 84 print ('%s environment variable not set, using default' % |
85 ENVVAR_GYP_GENERATORS) | 85 ENVVAR_GYP_GENERATORS) |
86 if sys.platform.startswith('darwin'): | 86 if sys.platform.startswith('darwin'): |
87 default_gyp_generators = 'xcode' | 87 default_gyp_generators = 'ninja,xcode' |
88 elif sys.platform.startswith('win'): | 88 elif sys.platform.startswith('win'): |
89 default_gyp_generators = 'msvs' | 89 default_gyp_generators = 'ninja,msvs' |
90 elif sys.platform.startswith('cygwin'): | 90 elif sys.platform.startswith('cygwin'): |
91 default_gyp_generators = 'msvs' | 91 default_gyp_generators = 'ninja,msvs' |
92 else: | 92 else: |
93 default_gyp_generators = 'make' | 93 default_gyp_generators = 'ninja' |
94 os.environ[ENVVAR_GYP_GENERATORS] = default_gyp_generators | 94 os.environ[ENVVAR_GYP_GENERATORS] = default_gyp_generators |
95 print '%s is "%s"' % (ENVVAR_GYP_GENERATORS, os.getenv(ENVVAR_GYP_GENERATORS)) | 95 print '%s is "%s"' % (ENVVAR_GYP_GENERATORS, os.getenv(ENVVAR_GYP_GENERATORS)) |
96 | 96 |
97 # Set CWD to the directory containing this script. | 97 # Set CWD to the directory containing this script. |
98 # This allows us to launch it from other directories, in spite of gyp's | 98 # This allows us to launch it from other directories, in spite of gyp's |
99 # finickyness about the current working directory. | 99 # finickyness about the current working directory. |
100 # See http://b.corp.google.com/issue?id=5019517 ('Linux make build | 100 # See http://b.corp.google.com/issue?id=5019517 ('Linux make build |
101 # (from out dir) no longer runs skia_gyp correctly') | 101 # (from out dir) no longer runs skia_gyp correctly') |
102 os.chdir(os.path.abspath(script_dir)) | 102 os.chdir(os.path.abspath(script_dir)) |
103 | 103 |
(...skipping 22 matching lines...) Expand all Loading... |
126 args.extend(['-Goutput_dir=.']) | 126 args.extend(['-Goutput_dir=.']) |
127 | 127 |
128 # By default, we build 'most' instead of 'all' or 'everything'. See skia.gyp. | 128 # By default, we build 'most' instead of 'all' or 'everything'. See skia.gyp. |
129 args.extend(['-Gdefault_target=most']) | 129 args.extend(['-Gdefault_target=most']) |
130 | 130 |
131 print 'Updating projects from gyp files...' | 131 print 'Updating projects from gyp files...' |
132 sys.stdout.flush() | 132 sys.stdout.flush() |
133 | 133 |
134 # Off we go... | 134 # Off we go... |
135 sys.exit(gyp.main(args)) | 135 sys.exit(gyp.main(args)) |
OLD | NEW |