Skip to content

Commit

Permalink
Fix JNI generation on Darwin and XCode 5.1
Browse files Browse the repository at this point in the history
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 5130af6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion base/android/jni_generator/jni_generator.py
Expand Up @@ -17,6 +17,7 @@
import sys
import textwrap
import zipfile
import platform


class ParseError(Exception):
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5130af6

Please sign in to comment.