OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to generate jni bindings for Java-files in a consistent manner. | 6 # to generate jni bindings for Java-files in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'base_jni_headers', | 10 # 'target_name': 'base_jni_headers', |
(...skipping 19 matching lines...) Expand all Loading... |
30 { | 30 { |
31 'variables': { | 31 'variables': { |
32 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py', | 32 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py', |
33 'jni_generator_jarjar_file%': '', | 33 'jni_generator_jarjar_file%': '', |
34 'jni_generator_ptr_type%': 'long', | 34 'jni_generator_ptr_type%': 'long', |
35 # A comma separated string of include files. | 35 # A comma separated string of include files. |
36 'jni_generator_includes%': ( | 36 'jni_generator_includes%': ( |
37 'base/android/jni_generator/jni_generator_helper.h' | 37 'base/android/jni_generator/jni_generator_helper.h' |
38 ), | 38 ), |
39 }, | 39 }, |
| 40 'dependencies': [ |
| 41 '<(DEPTH)/build/linker_script_copy.gyp:linker_script_copy', |
| 42 ], |
40 'rules': [ | 43 'rules': [ |
41 { | 44 { |
42 'rule_name': 'generate_jni_headers', | 45 'rule_name': 'generate_jni_headers', |
43 'extension': 'java', | 46 'extension': 'java', |
44 'inputs': [ | 47 'inputs': [ |
45 '<(jni_generator)', | 48 '<(jni_generator)', |
46 ], | 49 ], |
47 'outputs': [ | 50 'outputs': [ |
48 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(RULE_INPUT_ROOT)_jn
i.h', | 51 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni/<(RULE_INPUT_ROOT)_jn
i.h', |
49 ], | 52 ], |
50 'action': [ | 53 'action': [ |
51 '<(jni_generator)', | 54 '<(jni_generator)', |
52 '--input_file', | 55 '--input_file', |
53 '<(RULE_INPUT_PATH)', | 56 '<(RULE_INPUT_PATH)', |
54 '--output_dir', | 57 '--output_dir', |
55 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni', | 58 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni', |
56 '--includes', | 59 '--includes', |
57 '<(jni_generator_includes)', | 60 '<(jni_generator_includes)', |
58 '--optimize_generation', | 61 '--optimize_generation', |
59 '<(optimize_jni_generation)', | 62 '<(optimize_jni_generation)', |
60 '--jarjar', | 63 '--jarjar', |
61 '<(jni_generator_jarjar_file)', | 64 '<(jni_generator_jarjar_file)', |
62 '--ptr_type', | 65 '--ptr_type', |
63 '<(jni_generator_ptr_type)', | 66 '<(jni_generator_ptr_type)', |
| 67 '--native_exports', |
64 ], | 68 ], |
65 'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)', | 69 'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)', |
66 'process_outputs_as_sources': 1, | 70 'process_outputs_as_sources': 1, |
67 'conditions': [ | 71 'conditions': [ |
68 ['jni_generator_jarjar_file != ""', { | 72 ['jni_generator_jarjar_file != ""', { |
69 'inputs': [ | 73 'inputs': [ |
70 '<(jni_generator_jarjar_file)', | 74 '<(jni_generator_jarjar_file)', |
71 ], | 75 ], |
72 }] | 76 }] |
73 ], | 77 ], |
74 }, | 78 }, |
75 ], | 79 ], |
76 'direct_dependent_settings': { | 80 'direct_dependent_settings': { |
77 'include_dirs': [ | 81 'include_dirs': [ |
78 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)', | 82 '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)', |
79 ], | 83 ], |
80 }, | 84 }, |
81 # This target exports a hard dependency because it generates header | 85 # This target exports a hard dependency because it generates header |
82 # files. | 86 # files. |
83 'hard_dependency': 1, | 87 'hard_dependency': 1, |
| 88 'conditions': [ |
| 89 ['component=="static_library"', { |
| 90 'link_settings': { |
| 91 'ldflags': [ |
| 92 # Only export symbols that are specified in version script. |
| 93 '-Wl,--version-script=<(android_linker_script)', |
| 94 ], |
| 95 'ldflags!': [ |
| 96 '-Wl,--exclude-libs=ALL', |
| 97 ], |
| 98 }, |
| 99 }], |
| 100 ], |
84 } | 101 } |
| 102 |
OLD | NEW |