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/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") |
9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
10 import("//third_party/android_platform/config.gni") | 10 import("//third_party/android_platform/config.gni") |
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 # (optional). | 1260 # (optional). |
1261 # apk_under_test: For an instrumentation test apk, this is the target of the | 1261 # apk_under_test: For an instrumentation test apk, this is the target of the |
1262 # tested apk. | 1262 # tested apk. |
1263 # include_all_resources - If true include all resource IDs in all generated | 1263 # include_all_resources - If true include all resource IDs in all generated |
1264 # R.java files. | 1264 # R.java files. |
1265 # testonly: Marks this target as "test-only". | 1265 # testonly: Marks this target as "test-only". |
1266 # write_asset_list: Adds an extra file to the assets, which contains a list of | 1266 # write_asset_list: Adds an extra file to the assets, which contains a list of |
1267 # all other asset files. | 1267 # all other asset files. |
1268 # alternative_locale_resource_dep: The locale resource target which overrides | 1268 # alternative_locale_resource_dep: The locale resource target which overrides |
1269 # any exsting locale resources in dep graph. | 1269 # any exsting locale resources in dep graph. |
| 1270 # requires_sdk_api_level_23: If defined and true, the apk is intended for |
| 1271 # installation only on Android M or later. In these releases the system |
| 1272 # linker does relocation unpacking, so we can enable it unconditionally. |
1270 # | 1273 # |
1271 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in | 1274 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in |
1272 # this directory will be included in the library. This is only supported to | 1275 # this directory will be included in the library. This is only supported to |
1273 # ease the gyp->gn conversion and will be removed in the future. | 1276 # ease the gyp->gn conversion and will be removed in the future. |
1274 # | 1277 # |
1275 # Example | 1278 # Example |
1276 # android_apk("foo_apk") { | 1279 # android_apk("foo_apk") { |
1277 # android_manifest = "AndroidManifest.xml" | 1280 # android_manifest = "AndroidManifest.xml" |
1278 # java_files = [ | 1281 # java_files = [ |
1279 # "android/org/chromium/foo/FooApplication.java", | 1282 # "android/org/chromium/foo/FooApplication.java", |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 if (defined(invoker.srcjar_deps)) { | 1361 if (defined(invoker.srcjar_deps)) { |
1359 _srcjar_deps += invoker.srcjar_deps | 1362 _srcjar_deps += invoker.srcjar_deps |
1360 } | 1363 } |
1361 | 1364 |
1362 _use_chromium_linker = | 1365 _use_chromium_linker = |
1363 defined(invoker.use_chromium_linker) && invoker.use_chromium_linker | 1366 defined(invoker.use_chromium_linker) && invoker.use_chromium_linker |
1364 _enable_relocation_packing = defined(invoker.enable_relocation_packing) && | 1367 _enable_relocation_packing = defined(invoker.enable_relocation_packing) && |
1365 invoker.enable_relocation_packing | 1368 invoker.enable_relocation_packing |
1366 _load_library_from_apk = | 1369 _load_library_from_apk = |
1367 defined(invoker.load_library_from_apk) && invoker.load_library_from_apk | 1370 defined(invoker.load_library_from_apk) && invoker.load_library_from_apk |
| 1371 _requires_sdk_api_level_23 = defined(invoker.requires_sdk_api_level_23) && |
| 1372 invoker.requires_sdk_api_level_23 |
1368 | 1373 |
1369 assert(_use_chromium_linker || true) # Mark as used. | 1374 assert(_use_chromium_linker || true) # Mark as used. |
| 1375 assert(_requires_sdk_api_level_23 || true) |
1370 if (_enable_relocation_packing) { | 1376 if (_enable_relocation_packing) { |
1371 assert(_use_chromium_linker, | 1377 assert(_use_chromium_linker || _requires_sdk_api_level_23, |
1372 "enable_relocation_packing requires use_chromium_linker") | 1378 "enable_relocation_packing requires either use_chromium_linker " + |
| 1379 "or requires_sdk_api_level_23") |
1373 } | 1380 } |
1374 if (_load_library_from_apk) { | 1381 if (_load_library_from_apk) { |
1375 assert(_use_chromium_linker, | 1382 assert(_use_chromium_linker || _requires_sdk_api_level_23, |
1376 "load_library_from_apk requires use_chromium_linker") | 1383 "load_library_from_apk requires use_chromium_linker " + |
| 1384 "or requires_sdk_api_level_23") |
1377 } | 1385 } |
1378 | 1386 |
1379 # The dependency that makes the chromium linker, if any is needed. | 1387 # The dependency that makes the chromium linker, if any is needed. |
1380 _native_libs_deps = [] | 1388 _native_libs_deps = [] |
1381 | 1389 |
1382 if (defined(invoker.native_libs) && invoker.native_libs != []) { | 1390 if (defined(invoker.native_libs) && invoker.native_libs != []) { |
1383 if (is_component_build || is_asan) { | 1391 if (is_component_build || is_asan) { |
1384 _native_libs += [ "$root_shlib_dir/libc++_shared.so" ] | 1392 _native_libs += [ "$root_shlib_dir/libc++_shared.so" ] |
1385 _native_libs_deps += [ "//build/android:cpplib_stripped" ] | 1393 _native_libs_deps += [ "//build/android:cpplib_stripped" ] |
1386 } | 1394 } |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2416 "--target", | 2424 "--target", |
2417 rebase_path(invoker.target, root_build_dir), | 2425 rebase_path(invoker.target, root_build_dir), |
2418 "--output-directory", | 2426 "--output-directory", |
2419 rebase_path(root_out_dir, root_build_dir), | 2427 rebase_path(root_out_dir, root_build_dir), |
2420 ] | 2428 ] |
2421 if (defined(invoker.flag_name)) { | 2429 if (defined(invoker.flag_name)) { |
2422 args += [ "--flag-name=${invoker.flag_name}" ] | 2430 args += [ "--flag-name=${invoker.flag_name}" ] |
2423 } | 2431 } |
2424 } | 2432 } |
2425 } | 2433 } |
OLD | NEW |