Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1089)

Unified Diff: build/config/android/internal_rules.gni

Issue 2319273002: Make secondary abi work for component build (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index db0c06185bfd8fc0b3adc2ad43ac6c477f1f1d94..ea20180662e4451b6d8c3b8d432dd88f4aa5da96 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -5,6 +5,7 @@
import("//build_overrides/build.gni")
import("//build/config/android/config.gni")
import("//build/config/sanitizers/sanitizers.gni")
+import("//third_party/android_platform/config.gni")
assert(is_android)
@@ -301,6 +302,17 @@ template("write_build_config") {
]
}
+ if (defined(invoker.secondary_abi_shared_libraries_runtime_deps_file)) {
+ # Don't list secondary_abi_shared_libraries_runtime_deps_file as an
+ # input in order to avoid having to depend on the runtime_deps target.
+ # See comment in rules.gni for why we do this.
+ args += [
+ "--secondary-abi-shared-libraries-runtime-deps",
+ rebase_path(invoker.secondary_abi_shared_libraries_runtime_deps_file,
+ root_build_dir),
+ ]
+ }
+
if (defined(invoker.proguard_enabled) && invoker.proguard_enabled) {
args += [
"--proguard-enabled",
@@ -1279,8 +1291,16 @@ if (enable_java_templates) {
if (_native_lib_placeholders != []) {
args += [ "--native-lib-placeholders=$_native_lib_placeholders" ]
}
- if (defined(invoker.secondary_native_libs) &&
- invoker.secondary_native_libs != []) {
+
+ # TODO (michaelbai): Remove the secondary_native_libs variable.
+ if (defined(invoker.secondary_abi_native_libs_filearg)) {
+ assert(defined(android_app_secondary_abi))
+ args += [
+ "--secondary-native-libs=${invoker.secondary_abi_native_libs_filearg}",
+ "--secondary-android-abi=$android_app_secondary_abi",
+ ]
+ } else if (defined(invoker.secondary_native_libs) &&
+ invoker.secondary_native_libs != []) {
assert(defined(android_app_secondary_abi))
inputs += invoker.secondary_native_libs
_secondary_native_libs = rebase_path(invoker.secondary_native_libs)
@@ -1608,6 +1628,7 @@ if (enable_java_templates) {
"emma_instrument",
"native_lib_placeholders",
"native_libs_filearg",
+ "secondary_abi_native_libs_filearg",
"secondary_native_libs",
"uncompress_shared_libraries",
"write_asset_list",
@@ -2654,3 +2675,41 @@ if (enable_java_templates) {
}
}
}
+
+template("pack_relocation_section") {
+ assert(defined(invoker.file_list_json))
+ assert(defined(invoker.libraries_filearg))
+ action(target_name) {
+ forward_variables_from(invoker,
+ [
+ "deps",
+ "public_deps",
+ "file_list_json",
agrieve 2016/09/08 01:02:15 nit: don't forward file_list_json and libraries_fi
michaelbai 2016/09/08 18:52:51 Thanks, sometime, I am confused about what should
+ "inputs",
+ "libraries_filearg",
+ "testonly",
+ ])
+ script = "//build/android/gyp/pack_relocations.py"
+ depfile = "$target_gen_dir/$target_name.d"
+ packed_libraries_dir = "$target_gen_dir/$target_name/packed-libs"
agrieve 2016/09/08 01:02:15 nit: prefix with _
michaelbai 2016/09/08 18:52:51 Done.
+ outputs = [
+ file_list_json,
+ ]
+ deps += [ relocation_packer_target ]
+
+ args = [
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--enable-packing=1",
+ "--android-pack-relocations",
+ rebase_path(relocation_packer_exe, root_build_dir),
+ "--stripped-libraries-dir",
+ rebase_path(root_build_dir, root_build_dir),
+ "--packed-libraries-dir",
+ rebase_path(packed_libraries_dir, root_build_dir),
+ "--libraries=$libraries_filearg",
+ "--filelistjson",
+ rebase_path(file_list_json, root_build_dir),
+ ]
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698