Permalink
Browse files

Fix JNI generation on Darwin and XCode 5.1

clang now errors out if an unknown argument is used:
$ cpp -fpreprocessed
clang: error: unknown argument: '-fpreprocessed' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

This is ugly but works...

Change-Id: I47d91f132f6222413147807ffd2ac5bcc4256896
  • Loading branch information...
aeroevan committed Mar 12, 2014
1 parent ff0a1c9 commit 5130af630390487b37d99941887883647c67f37a
Showing with 7 additions and 1 deletion.
  1. +7 −1 base/android/jni_generator/jni_generator.py
@@ -17,6 +17,7 @@
import sys
import textwrap
import zipfile
import platform


class ParseError(Exception):
@@ -552,7 +553,12 @@ def _RemoveComments(self, contents):
# parser. Maybe we could ditch JNIFromJavaSource and just always use
# JNIFromJavaP; or maybe we could rewrite this script in Java and use APT.
# http://code.google.com/p/chromium/issues/detail?id=138941
p = subprocess.Popen(args=['cpp', '-fpreprocessed'],
system = platform.system()
if system == 'Darwin':
cpp_args = ['cpp']
else:
cpp_args = ['cpp', '-fpreprocessed']
p = subprocess.Popen(args=cpp_args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)

0 comments on commit 5130af6

Please sign in to comment.