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

Side by Side Diff: build/android/gyp/gcc_preprocess.py

Issue 2101243005: Add a snapshot of flutter/engine/src/build to our sdk (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add README.dart Created 4 years, 5 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
« no previous file with comments | « build/android/gyp/find_sun_tools_jar.py ('k') | build/android/gyp/generate_split_manifest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 import optparse
8 import os
9 import sys
10
11 from util import build_utils
12
13 def DoGcc(options):
14 build_utils.MakeDirectory(os.path.dirname(options.output))
15
16 gcc_cmd = [ 'gcc' ] # invoke host gcc.
17 if options.defines:
18 gcc_cmd.extend(sum(map(lambda w: ['-D', w], options.defines), []))
19 gcc_cmd.extend([
20 '-E', # stop after preprocessing.
21 '-D', 'ANDROID', # Specify ANDROID define for pre-processor.
22 '-x', 'c-header', # treat sources as C header files
23 '-P', # disable line markers, i.e. '#line 309'
24 '-I', options.include_path,
25 '-o', options.output,
26 options.template
27 ])
28
29 build_utils.CheckOutput(gcc_cmd)
30
31
32 def main(args):
33 args = build_utils.ExpandFileArgs(args)
34
35 parser = optparse.OptionParser()
36 build_utils.AddDepfileOption(parser)
37
38 parser.add_option('--include-path', help='Include path for gcc.')
39 parser.add_option('--template', help='Path to template.')
40 parser.add_option('--output', help='Path for generated file.')
41 parser.add_option('--stamp', help='Path to touch on success.')
42 parser.add_option('--defines', help='Pre-defines macros', action='append')
43
44 options, _ = parser.parse_args(args)
45
46 DoGcc(options)
47
48 if options.depfile:
49 build_utils.WriteDepfile(
50 options.depfile,
51 build_utils.GetPythonDependencies())
52
53 if options.stamp:
54 build_utils.Touch(options.stamp)
55
56
57 if __name__ == '__main__':
58 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « build/android/gyp/find_sun_tools_jar.py ('k') | build/android/gyp/generate_split_manifest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698