| Index: build/android/gyp/gcc_preprocess.py
|
| diff --git a/build/android/gyp/gcc_preprocess.py b/build/android/gyp/gcc_preprocess.py
|
| index 93efdb3a741dfc0edc035a494c80e811c0edbdd8..eb1a4d156be82568a2faeb8082cb9d530b5f5494 100755
|
| --- a/build/android/gyp/gcc_preprocess.py
|
| +++ b/build/android/gyp/gcc_preprocess.py
|
| @@ -14,8 +14,11 @@ from util import build_utils
|
| def DoGcc(options):
|
| build_utils.MakeDirectory(os.path.dirname(options.output))
|
|
|
| - gcc_cmd = [
|
| - 'gcc', # invoke host gcc.
|
| + gcc_cmd = [ 'gcc' ] # invoke host gcc.
|
| + if options.D:
|
| + gcc_cmd.extend(sum(map(lambda w: ['-D', w], options.D), []))
|
| + gcc_cmd.extend([
|
| + '-D', 'ANDROID',
|
| '-E', # stop after preprocessing.
|
| '-D', 'ANDROID', # Specify ANDROID define for pre-processor.
|
| '-x', 'c-header', # treat sources as C header files
|
| @@ -23,7 +26,8 @@ def DoGcc(options):
|
| '-I', options.include_path,
|
| '-o', options.output,
|
| options.template
|
| - ]
|
| + ])
|
| +
|
|
|
| build_utils.CheckCallDie(gcc_cmd)
|
|
|
| @@ -34,6 +38,7 @@ def main(argv):
|
| parser.add_option('--template', help='Path to template.')
|
| parser.add_option('--output', help='Path for generated file.')
|
| parser.add_option('--stamp', help='Path to touch on success.')
|
| + parser.add_option('-D', help='Pre-defines macros', action='append')
|
|
|
| # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
|
| parser.add_option('--ignore', help='Ignored.')
|
|
|