summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authortedchoc@chromium.org <tedchoc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-22 00:37:33 +0000
committertedchoc@chromium.org <tedchoc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-22 00:37:33 +0000
commitd8621ce6610cc44ceda9f12aabc3526636934df4 (patch)
tree879fe3590168c1472a98a0d2692b06d6b822fe50 /build
parentcb80af8ba224c8fbb1f45cdd9653caa0c739e2b1 (diff)
downloadchromium_src-d8621ce6610cc44ceda9f12aabc3526636934df4.zip
chromium_src-d8621ce6610cc44ceda9f12aabc3526636934df4.tar.gz
chromium_src-d8621ce6610cc44ceda9f12aabc3526636934df4.tar.bz2
Add gyp flag to specify whether we should optimize JNI generation.
Do not regenerate JNI files (and subsequently the .so file) if they have not changed. This will happen if you edit a java file that has a native counterpart, but the native signatures were not touched. We do not enable this all the time as some build systems require that when you modify an input, the output should also be modified. This also will result in more command line output, so we'll keep it behind a developer flag for now. BUG= Review URL: https://chromiumcodereview.appspot.com/12314025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/common.gypi6
-rw-r--r--build/jar_file_jni_generator.gypi2
-rw-r--r--build/jni_generator.gypi2
3 files changed, 10 insertions, 0 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 6ac534d..605cd55 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1154,6 +1154,12 @@
# to specify the output directory for Ant in the Android build.
'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`',
+ # Determines whether we should optimize JNI generation at the cost of
+ # breaking assumptions in the build system that when inputs have changed
+ # the outputs should always change as well. This is meant purely for
+ # developer builds, to avoid spurious re-linking of native files.
+ 'optimize_jni_generation%': 0,
+
# Always uses openssl.
'use_openssl%': 1,
diff --git a/build/jar_file_jni_generator.gypi b/build/jar_file_jni_generator.gypi
index 3c14cf8..2f03b85 100644
--- a/build/jar_file_jni_generator.gypi
+++ b/build/jar_file_jni_generator.gypi
@@ -42,6 +42,8 @@
'<(input_java_class)',
'--output_dir',
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni',
+ '--optimize_generation',
+ '<(optimize_jni_generation)',
],
'message': 'Generating JNI bindings from <(input_jar_file)/<(input_java_class)',
'process_outputs_as_sources': 1,
diff --git a/build/jni_generator.gypi b/build/jni_generator.gypi
index 837d9ab..d45daaaf 100644
--- a/build/jni_generator.gypi
+++ b/build/jni_generator.gypi
@@ -47,6 +47,8 @@
'<(RULE_INPUT_PATH)',
'--output_dir',
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni',
+ '--optimize_generation',
+ '<(optimize_jni_generation)',
],
'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)',
'process_outputs_as_sources': 1,