Index: build/config/android/rules.gni |
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni |
index faf5a964316dd0244aea0cff3b842d3b3cea5fbb..02d976bd5b50cd54fb7f6e8a35004fd140d23ece 100644 |
--- a/build/config/android/rules.gni |
+++ b/build/config/android/rules.gni |
@@ -1508,17 +1508,6 @@ if (enable_java_templates) { |
if (_shared_libraries_is_valid) { |
_native_libs_deps += invoker.shared_libraries |
- # To determine the filenames of all dependent shared libraries, write the |
- # runtime deps of |shared_libraries| to a file during "gn gen". |
- # write_build_config.py will then grep this file for *.so to obtain the |
- # complete list. |
- _runtime_deps_file = |
- "$target_gen_dir/${_template_name}.native.runtimedeps" |
- group("${_template_name}__runtime_deps") { |
- deps = _native_libs_deps |
- write_runtime_deps = _runtime_deps_file |
- } |
- |
_native_lib_version_rule = "" |
if (defined(invoker.native_lib_version_rule)) { |
_native_lib_version_rule = invoker.native_lib_version_rule |
@@ -1527,20 +1516,49 @@ if (enable_java_templates) { |
if (defined(invoker.native_lib_version_arg)) { |
_native_lib_version_arg = invoker.native_lib_version_arg |
} |
+ |
+ # To determine the filenames of direct dependent and all dependent |
+ # shared libraries, write the runtime deps of |shared_libraries| to |
+ # files respectively during "gn gen". write_build_config.py will |
+ # then grep those files for *.so. |
+ _shared_libraries_runtime_deps_files = [] |
+ _count = 0 |
+ foreach(_native_libs_dep, _native_libs_deps) { |
+ _count += 1 |
+ _name = get_label_info(_native_libs_dep, "name") |
+ _runtime_deps_file = "$target_gen_dir/${_template_name}.${_count}.${_name}.native.runtimedeps" |
+ _shared_libraries_runtime_deps_files += [ _runtime_deps_file ] |
+ group("${_template_name}_${_count}_${_name}__runtime_deps") { |
+ deps = [ |
+ _native_libs_dep, |
+ ] |
+ write_runtime_deps = _runtime_deps_file |
+ } |
+ } |
} |
if (_secondary_abi_shared_libraries_is_valid) { |
_secondary_abi_native_libs_deps += invoker.secondary_abi_shared_libraries |
- # To determine the filenames of all dependent shared libraries, write the |
- # runtime deps of |shared_libraries| to a file during "gn gen". |
- # write_build_config.py will then grep this file for *.so to obtain the |
- # complete list. |
- _secondary_abi_runtime_deps_file = |
- "$target_gen_dir/${_template_name}.secondary.abi.native.runtimedeps" |
- group("${_template_name}_secondary_abi__runtime_deps") { |
- deps = _secondary_abi_native_libs_deps |
- write_runtime_deps = _secondary_abi_runtime_deps_file |
+ # To determine the filenames of direct dependent and all dependent |
+ # shared libraries, write the runtime deps of |shared_libraries| to |
+ # files respectively during "gn gen". write_build_config.py will |
+ # then grep those files for *.so. |
+ _secondary_abi_shared_libraries_runtime_deps_files = [] |
+ _count = 0 |
+ foreach(_native_libs_dep, _secondary_abi_native_libs_deps) { |
+ _count += 1 |
+ _name = get_label_info(_native_libs_dep, "name") |
+ _runtime_deps_file = "$target_gen_dir/${_template_name}.${_count}.${_name}.secondary.abi.native.runtimedeps" |
+ _secondary_abi_shared_libraries_runtime_deps_files += |
+ [ _runtime_deps_file ] |
+ group( |
+ "${_template_name}_${_count}_${_name}_secondary_abi__runtime_deps") { |
+ deps = [ |
+ _native_libs_dep, |
+ ] |
+ write_runtime_deps = _runtime_deps_file |
+ } |
} |
} |
@@ -1615,11 +1633,12 @@ if (enable_java_templates) { |
# The dep is unnecessary since the runtime_deps file is created by gn gen |
# and the runtime_deps file is added to write_build_config.py's depfile. |
if (_native_libs_deps != []) { |
- shared_libraries_runtime_deps_file = _runtime_deps_file |
+ shared_libraries_runtime_deps_file = |
+ _shared_libraries_runtime_deps_files |
} |
if (_secondary_abi_native_libs_deps != []) { |
secondary_abi_shared_libraries_runtime_deps_file = |
- _secondary_abi_runtime_deps_file |
+ _secondary_abi_shared_libraries_runtime_deps_files |
} |
} |
@@ -1658,28 +1677,6 @@ if (enable_java_templates) { |
if (defined(invoker.enable_chromium_linker_tests)) { |
_enable_chromium_linker_tests = invoker.enable_chromium_linker_tests |
} |
- _ordered_libraries_json = |
- "$target_gen_dir/$target_name.ordered_libararies.json" |
- _rebased_ordered_libraries_json = |
- rebase_path(_ordered_libraries_json, root_build_dir) |
- _ordered_libraries_target = "${_template_name}__write_ordered_libraries" |
- |
- # TODO(agrieve): Make GN write runtime deps in dependency order so as to |
- # not need this manual sorting step. |
- action(_ordered_libraries_target) { |
- script = "//build/android/gyp/write_ordered_libraries.py" |
- deps = _native_libs_deps + [ ":$build_config_target" ] |
- outputs = [ |
- _ordered_libraries_json, |
- ] |
- _rebased_android_readelf = rebase_path(android_readelf, root_build_dir) |
- args = [ |
- "--readelf=$_rebased_android_readelf", |
- "--output=$_rebased_ordered_libraries_json", |
- "--libraries-dir=.", |
- "--input-libraries=@FileArg($_rebased_build_config:native:libraries)", |
- ] |
- } |
java_cpp_template("${_template_name}__native_libraries_java") { |
package_name = "org/chromium/base/library_loader" |
@@ -1687,18 +1684,16 @@ if (enable_java_templates) { |
"//base/android/java/templates/NativeLibraries.template", |
] |
inputs = [ |
- _ordered_libraries_json, |
- ] |
- deps = [ |
- ":${_ordered_libraries_target}", |
+ _build_config, |
] |
+ deps = _native_libs_deps + [ ":$build_config_target" ] |
if (_native_lib_version_rule != "") { |
deps += [ _native_lib_version_rule ] |
} |
defines = [ |
"NATIVE_LIBRARIES_LIST=" + |
- "@FileArg($_rebased_ordered_libraries_json:java_libraries_list)", |
+ "@FileArg($_rebased_build_config:native:java_libraries_list)", |
"NATIVE_LIBRARIES_VERSION_NUMBER=$_native_lib_version_arg", |
] |
if (_use_chromium_linker) { |