OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//base/android/linker/config.gni") | 5 import("//base/android/linker/config.gni") |
6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
7 import("//build/config/android/internal_rules.gni") | 7 import("//build/config/android/internal_rules.gni") |
8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
9 import("//third_party/android_platform/config.gni") | 9 import("//third_party/android_platform/config.gni") |
10 import("//tools/grit/grit_rule.gni") | 10 import("//tools/grit/grit_rule.gni") |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 } | 1230 } |
1231 | 1231 |
1232 if (defined(invoker.load_library_from_apk) && | 1232 if (defined(invoker.load_library_from_apk) && |
1233 invoker.load_library_from_apk) { | 1233 invoker.load_library_from_apk) { |
1234 _load_library_from_apk = true | 1234 _load_library_from_apk = true |
1235 assert(_use_chromium_linker, | 1235 assert(_use_chromium_linker, |
1236 "Loading library from the apk requires use" + | 1236 "Loading library from the apk requires use" + |
1237 " of the Chromium linker.") | 1237 " of the Chromium linker.") |
1238 } | 1238 } |
1239 | 1239 |
1240 _enable_relocation_packing = false | |
1241 if (defined(invoker.enable_relocation_packing) && | |
1242 invoker.enable_relocation_packing) { | |
1243 _enable_relocation_packing = relocation_packing_supported | |
1244 assert(_use_chromium_linker, | |
1245 "Relocation packing requires use of the" + " Chromium linker.") | |
1246 } | |
1247 | |
1248 if (is_component_build) { | 1240 if (is_component_build) { |
1249 _native_libs += [ "$root_shlib_dir/libc++_shared.so" ] | 1241 _native_libs += [ "$root_shlib_dir/libc++_shared.so" ] |
1250 _chromium_linker_dep += [ "//build/android:cpplib_stripped" ] | 1242 _chromium_linker_dep += [ "//build/android:cpplib_stripped" ] |
1251 } | 1243 } |
1252 | 1244 |
1253 # Allow native_libs to be in the form "foo.so" or "foo.cr.so" | 1245 # Allow native_libs to be in the form "foo.so" or "foo.cr.so" |
1254 _first_ext_removed = | 1246 _first_ext_removed = |
1255 process_file_template(invoker.native_libs, "{{source_name_part}}") | 1247 process_file_template(invoker.native_libs, "{{source_name_part}}") |
1256 _native_libs += process_file_template( | 1248 _native_libs += process_file_template( |
1257 _first_ext_removed, | 1249 _first_ext_removed, |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 outputs = [ | 1463 outputs = [ |
1472 depfile, | 1464 depfile, |
1473 ] | 1465 ] |
1474 | 1466 |
1475 inputs = _native_libs | 1467 inputs = _native_libs |
1476 deps = _chromium_linker_dep | 1468 deps = _chromium_linker_dep |
1477 | 1469 |
1478 inputs += [ _build_config ] | 1470 inputs += [ _build_config ] |
1479 deps += [ ":$build_config_target" ] | 1471 deps += [ ":$build_config_target" ] |
1480 | 1472 |
| 1473 rebased_gdbserver = rebase_path(android_gdbserver, root_build_dir) |
1481 skip_packing_list = [ | 1474 skip_packing_list = [ |
1482 "gdbserver", | 1475 rebased_gdbserver, |
1483 "libchromium_android_linker$shlib_extension", | 1476 "libchromium_android_linker.so", |
1484 ] | 1477 ] |
1485 | 1478 |
1486 enable_packing_arg = 0 | 1479 enable_packing_arg = 0 |
1487 if (_enable_relocation_packing) { | 1480 if (_enable_relocation_packing) { |
1488 enable_packing_arg = 1 | 1481 enable_packing_arg = 1 |
1489 deps += [ relocation_packer_target ] | 1482 deps += [ relocation_packer_target ] |
1490 } | 1483 } |
1491 | 1484 |
1492 args = [ | 1485 args = [ |
1493 "--depfile", | 1486 "--depfile", |
1494 rebase_path(depfile, root_build_dir), | 1487 rebase_path(depfile, root_build_dir), |
1495 "--enable-packing=$enable_packing_arg", | 1488 "--enable-packing=$enable_packing_arg", |
1496 "--exclude-packing-list=$skip_packing_list", | 1489 "--exclude-packing-list=$skip_packing_list", |
1497 "--android-pack-relocations", | 1490 "--android-pack-relocations", |
1498 rebase_path(relocation_packer_exe, root_build_dir), | 1491 rebase_path(relocation_packer_exe, root_build_dir), |
1499 "--stripped-libraries-dir", | 1492 "--stripped-libraries-dir", |
1500 rebase_path(root_build_dir, root_build_dir), | 1493 rebase_path(root_build_dir, root_build_dir), |
1501 "--packed-libraries-dir", | 1494 "--packed-libraries-dir", |
1502 rebase_path(packed_libraries_dir, root_build_dir), | 1495 rebase_path(packed_libraries_dir, root_build_dir), |
1503 "--libraries=@FileArg(${_rebased_build_config}:native:libraries)", | 1496 "--libraries=@FileArg(${_rebased_build_config}:native:libraries)", |
1504 "--clear-dir", | 1497 "--clear-dir", |
1505 ] | 1498 ] |
1506 | 1499 |
1507 if (defined(invoker.deps)) { | 1500 if (defined(invoker.deps)) { |
1508 deps += invoker.deps | 1501 deps += invoker.deps |
1509 } | 1502 } |
1510 | 1503 |
1511 if (is_debug) { | 1504 if (is_debug) { |
1512 rebased_gdbserver = rebase_path([ android_gdbserver ], root_build_dir) | |
1513 inputs += [ android_gdbserver ] | 1505 inputs += [ android_gdbserver ] |
1514 args += [ "--libraries=$rebased_gdbserver" ] | 1506 args += [ "--libraries=$rebased_gdbserver" ] |
1515 } | 1507 } |
1516 } | 1508 } |
1517 } | 1509 } |
1518 | 1510 |
1519 _final_deps += [ ":${_template_name}__create" ] | 1511 _final_deps += [ ":${_template_name}__create" ] |
1520 create_apk("${_template_name}__create") { | 1512 create_apk("${_template_name}__create") { |
1521 deps = [] | 1513 deps = [] |
1522 forward_variables_from(invoker, | 1514 forward_variables_from(invoker, |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2046 | 2038 |
2047 # TODO(GYP): implement this. | 2039 # TODO(GYP): implement this. |
2048 template("uiautomator_test") { | 2040 template("uiautomator_test") { |
2049 set_sources_assignment_filter([]) | 2041 set_sources_assignment_filter([]) |
2050 forward_variables_from(invoker, [ "testonly" ]) | 2042 forward_variables_from(invoker, [ "testonly" ]) |
2051 assert(target_name != "") | 2043 assert(target_name != "") |
2052 assert(invoker.deps != [] || true) | 2044 assert(invoker.deps != [] || true) |
2053 group(target_name) { | 2045 group(target_name) { |
2054 } | 2046 } |
2055 } | 2047 } |
OLD | NEW |