| 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 # Do not add any imports to non-//build directories here. | 5 # Do not add any imports to non-//build directories here. | 
| 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. | 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. | 
| 7 import("//build/config/android/config.gni") | 7 import("//build/config/android/config.gni") | 
| 8 import("//build/config/android/internal_rules.gni") | 8 import("//build/config/android/internal_rules.gni") | 
| 9 import("//build/config/dcheck_always_on.gni") | 9 import("//build/config/dcheck_always_on.gni") | 
| 10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") | 
| (...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1501         _native_libs_deps += [ "//build/android:cpplib_stripped" ] | 1501         _native_libs_deps += [ "//build/android:cpplib_stripped" ] | 
| 1502       } | 1502       } | 
| 1503       if (_secondary_abi_shared_libraries_is_valid) { | 1503       if (_secondary_abi_shared_libraries_is_valid) { | 
| 1504         _secondary_abi_native_libs_deps += [ "//build/android:cpplib_stripped($a
      ndroid_secondary_abi_toolchain)" ] | 1504         _secondary_abi_native_libs_deps += [ "//build/android:cpplib_stripped($a
      ndroid_secondary_abi_toolchain)" ] | 
| 1505       } | 1505       } | 
| 1506     } | 1506     } | 
| 1507 | 1507 | 
| 1508     if (_shared_libraries_is_valid) { | 1508     if (_shared_libraries_is_valid) { | 
| 1509       _native_libs_deps += invoker.shared_libraries | 1509       _native_libs_deps += invoker.shared_libraries | 
| 1510 | 1510 | 
| 1511       # To determine the filenames of all dependent shared libraries, write the |  | 
| 1512       # runtime deps of |shared_libraries| to a file during "gn gen". |  | 
| 1513       # write_build_config.py will then grep this file for *.so to obtain the |  | 
| 1514       # complete list. |  | 
| 1515       _runtime_deps_file = |  | 
| 1516           "$target_gen_dir/${_template_name}.native.runtimedeps" |  | 
| 1517       group("${_template_name}__runtime_deps") { |  | 
| 1518         deps = _native_libs_deps |  | 
| 1519         write_runtime_deps = _runtime_deps_file |  | 
| 1520       } |  | 
| 1521 |  | 
| 1522       _native_lib_version_rule = "" | 1511       _native_lib_version_rule = "" | 
| 1523       if (defined(invoker.native_lib_version_rule)) { | 1512       if (defined(invoker.native_lib_version_rule)) { | 
| 1524         _native_lib_version_rule = invoker.native_lib_version_rule | 1513         _native_lib_version_rule = invoker.native_lib_version_rule | 
| 1525       } | 1514       } | 
| 1526       _native_lib_version_arg = "\"\"" | 1515       _native_lib_version_arg = "\"\"" | 
| 1527       if (defined(invoker.native_lib_version_arg)) { | 1516       if (defined(invoker.native_lib_version_arg)) { | 
| 1528         _native_lib_version_arg = invoker.native_lib_version_arg | 1517         _native_lib_version_arg = invoker.native_lib_version_arg | 
| 1529       } | 1518       } | 
|  | 1519 | 
|  | 1520       # To determine the filenames of direct dependent and all dependent | 
|  | 1521       # shared libraries, write the runtime deps of |shared_libraries| to | 
|  | 1522       # files respectively during "gn gen". write_build_config.py will | 
|  | 1523       # then grep those files for *.so. | 
|  | 1524       _shared_libraries_runtime_deps_files = [] | 
|  | 1525       _count = 0 | 
|  | 1526       foreach(_native_libs_dep, _native_libs_deps) { | 
|  | 1527         _count += 1 | 
|  | 1528         _name = get_label_info(_native_libs_dep, "name") | 
|  | 1529         _runtime_deps_file = "$target_gen_dir/${_template_name}.${_count}.${_nam
      e}.native.runtimedeps" | 
|  | 1530         _shared_libraries_runtime_deps_files += [ _runtime_deps_file ] | 
|  | 1531         group("${_template_name}_${_count}_${_name}__runtime_deps") { | 
|  | 1532           deps = [ | 
|  | 1533             _native_libs_dep, | 
|  | 1534           ] | 
|  | 1535           write_runtime_deps = _runtime_deps_file | 
|  | 1536         } | 
|  | 1537       } | 
| 1530     } | 1538     } | 
| 1531 | 1539 | 
| 1532     if (_secondary_abi_shared_libraries_is_valid) { | 1540     if (_secondary_abi_shared_libraries_is_valid) { | 
| 1533       _secondary_abi_native_libs_deps += invoker.secondary_abi_shared_libraries | 1541       _secondary_abi_native_libs_deps += invoker.secondary_abi_shared_libraries | 
| 1534 | 1542 | 
| 1535       # To determine the filenames of all dependent shared libraries, write the | 1543       # To determine the filenames of direct dependent and all dependent | 
| 1536       # runtime deps of |shared_libraries| to a file during "gn gen". | 1544       # shared libraries, write the runtime deps of |shared_libraries| to | 
| 1537       # write_build_config.py will then grep this file for *.so to obtain the | 1545       # files respectively during "gn gen". write_build_config.py will | 
| 1538       # complete list. | 1546       # then grep those files for *.so. | 
| 1539       _secondary_abi_runtime_deps_file = | 1547       _secondary_abi_shared_libraries_runtime_deps_files = [] | 
| 1540           "$target_gen_dir/${_template_name}.secondary.abi.native.runtimedeps" | 1548       _count = 0 | 
| 1541       group("${_template_name}_secondary_abi__runtime_deps") { | 1549       foreach(_native_libs_dep, _secondary_abi_native_libs_deps) { | 
| 1542         deps = _secondary_abi_native_libs_deps | 1550         _count += 1 | 
| 1543         write_runtime_deps = _secondary_abi_runtime_deps_file | 1551         _name = get_label_info(_native_libs_dep, "name") | 
|  | 1552         _runtime_deps_file = "$target_gen_dir/${_template_name}.${_count}.${_nam
      e}.secondary.abi.native.runtimedeps" | 
|  | 1553         _secondary_abi_shared_libraries_runtime_deps_files += | 
|  | 1554             [ _runtime_deps_file ] | 
|  | 1555         group( | 
|  | 1556             "${_template_name}_${_count}_${_name}_secondary_abi__runtime_deps") 
      { | 
|  | 1557           deps = [ | 
|  | 1558             _native_libs_dep, | 
|  | 1559           ] | 
|  | 1560           write_runtime_deps = _runtime_deps_file | 
|  | 1561         } | 
| 1544       } | 1562       } | 
| 1545     } | 1563     } | 
| 1546 | 1564 | 
| 1547     if (defined(invoker.deps)) { | 1565     if (defined(invoker.deps)) { | 
| 1548       set_sources_assignment_filter([ "*manifest*" ]) | 1566       set_sources_assignment_filter([ "*manifest*" ]) | 
| 1549       sources = invoker.deps | 1567       sources = invoker.deps | 
| 1550       set_sources_assignment_filter([]) | 1568       set_sources_assignment_filter([]) | 
| 1551       if (sources != invoker.deps) { | 1569       if (sources != invoker.deps) { | 
| 1552         _bad_deps = invoker.deps - sources | 1570         _bad_deps = invoker.deps - sources | 
| 1553         assert( | 1571         assert( | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1608       proguard_enabled = _proguard_enabled | 1626       proguard_enabled = _proguard_enabled | 
| 1609       if (_proguard_enabled) { | 1627       if (_proguard_enabled) { | 
| 1610         proguard_info = "$_proguard_output_jar_path.info" | 1628         proguard_info = "$_proguard_output_jar_path.info" | 
| 1611       } | 1629       } | 
| 1612 | 1630 | 
| 1613       # Don't depend on the runtime_deps target in order to avoid having to | 1631       # Don't depend on the runtime_deps target in order to avoid having to | 
| 1614       # build the native libraries just to create the .build_config file. | 1632       # build the native libraries just to create the .build_config file. | 
| 1615       # The dep is unnecessary since the runtime_deps file is created by gn gen | 1633       # The dep is unnecessary since the runtime_deps file is created by gn gen | 
| 1616       # and the runtime_deps file is added to write_build_config.py's depfile. | 1634       # and the runtime_deps file is added to write_build_config.py's depfile. | 
| 1617       if (_native_libs_deps != []) { | 1635       if (_native_libs_deps != []) { | 
| 1618         shared_libraries_runtime_deps_file = _runtime_deps_file | 1636         shared_libraries_runtime_deps_file = | 
|  | 1637             _shared_libraries_runtime_deps_files | 
| 1619       } | 1638       } | 
| 1620       if (_secondary_abi_native_libs_deps != []) { | 1639       if (_secondary_abi_native_libs_deps != []) { | 
| 1621         secondary_abi_shared_libraries_runtime_deps_file = | 1640         secondary_abi_shared_libraries_runtime_deps_file = | 
| 1622             _secondary_abi_runtime_deps_file | 1641             _secondary_abi_shared_libraries_runtime_deps_files | 
| 1623       } | 1642       } | 
| 1624     } | 1643     } | 
| 1625 | 1644 | 
| 1626     _final_deps = [] | 1645     _final_deps = [] | 
| 1627 | 1646 | 
| 1628     _generated_proguard_config = "$base_path.resources.proguard.txt" | 1647     _generated_proguard_config = "$base_path.resources.proguard.txt" | 
| 1629     process_resources_target = "${_template_name}__process_resources" | 1648     process_resources_target = "${_template_name}__process_resources" | 
| 1630     process_resources(process_resources_target) { | 1649     process_resources(process_resources_target) { | 
| 1631       forward_variables_from(invoker, | 1650       forward_variables_from(invoker, | 
| 1632                              [ | 1651                              [ | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
| 1651         deps += invoker.deps | 1670         deps += invoker.deps | 
| 1652       } | 1671       } | 
| 1653     } | 1672     } | 
| 1654     _srcjar_deps += [ ":$process_resources_target" ] | 1673     _srcjar_deps += [ ":$process_resources_target" ] | 
| 1655 | 1674 | 
| 1656     if (_native_libs_deps != []) { | 1675     if (_native_libs_deps != []) { | 
| 1657       _enable_chromium_linker_tests = false | 1676       _enable_chromium_linker_tests = false | 
| 1658       if (defined(invoker.enable_chromium_linker_tests)) { | 1677       if (defined(invoker.enable_chromium_linker_tests)) { | 
| 1659         _enable_chromium_linker_tests = invoker.enable_chromium_linker_tests | 1678         _enable_chromium_linker_tests = invoker.enable_chromium_linker_tests | 
| 1660       } | 1679       } | 
| 1661       _ordered_libraries_json = |  | 
| 1662           "$target_gen_dir/$target_name.ordered_libararies.json" |  | 
| 1663       _rebased_ordered_libraries_json = |  | 
| 1664           rebase_path(_ordered_libraries_json, root_build_dir) |  | 
| 1665       _ordered_libraries_target = "${_template_name}__write_ordered_libraries" |  | 
| 1666 |  | 
| 1667       # TODO(agrieve): Make GN write runtime deps in dependency order so as to |  | 
| 1668       # not need this manual sorting step. |  | 
| 1669       action(_ordered_libraries_target) { |  | 
| 1670         script = "//build/android/gyp/write_ordered_libraries.py" |  | 
| 1671         deps = _native_libs_deps + [ ":$build_config_target" ] |  | 
| 1672         outputs = [ |  | 
| 1673           _ordered_libraries_json, |  | 
| 1674         ] |  | 
| 1675         _rebased_android_readelf = rebase_path(android_readelf, root_build_dir) |  | 
| 1676         args = [ |  | 
| 1677           "--readelf=$_rebased_android_readelf", |  | 
| 1678           "--output=$_rebased_ordered_libraries_json", |  | 
| 1679           "--libraries-dir=.", |  | 
| 1680           "--input-libraries=@FileArg($_rebased_build_config:native:libraries)", |  | 
| 1681         ] |  | 
| 1682       } |  | 
| 1683 | 1680 | 
| 1684       java_cpp_template("${_template_name}__native_libraries_java") { | 1681       java_cpp_template("${_template_name}__native_libraries_java") { | 
| 1685         package_name = "org/chromium/base/library_loader" | 1682         package_name = "org/chromium/base/library_loader" | 
| 1686         sources = [ | 1683         sources = [ | 
| 1687           "//base/android/java/templates/NativeLibraries.template", | 1684           "//base/android/java/templates/NativeLibraries.template", | 
| 1688         ] | 1685         ] | 
| 1689         inputs = [ | 1686         inputs = [ | 
| 1690           _ordered_libraries_json, | 1687           _build_config, | 
| 1691         ] | 1688         ] | 
| 1692         deps = [ | 1689         deps = _native_libs_deps + [ ":$build_config_target" ] | 
| 1693           ":${_ordered_libraries_target}", |  | 
| 1694         ] |  | 
| 1695         if (_native_lib_version_rule != "") { | 1690         if (_native_lib_version_rule != "") { | 
| 1696           deps += [ _native_lib_version_rule ] | 1691           deps += [ _native_lib_version_rule ] | 
| 1697         } | 1692         } | 
| 1698 | 1693 | 
| 1699         defines = [ | 1694         defines = [ | 
| 1700           "NATIVE_LIBRARIES_LIST=" + | 1695           "NATIVE_LIBRARIES_LIST=" + | 
| 1701               "@FileArg($_rebased_ordered_libraries_json:java_libraries_list)", | 1696               "@FileArg($_rebased_build_config:native:java_libraries_list)", | 
| 1702           "NATIVE_LIBRARIES_VERSION_NUMBER=$_native_lib_version_arg", | 1697           "NATIVE_LIBRARIES_VERSION_NUMBER=$_native_lib_version_arg", | 
| 1703         ] | 1698         ] | 
| 1704         if (_use_chromium_linker) { | 1699         if (_use_chromium_linker) { | 
| 1705           defines += [ "ENABLE_CHROMIUM_LINKER" ] | 1700           defines += [ "ENABLE_CHROMIUM_LINKER" ] | 
| 1706         } | 1701         } | 
| 1707         if (_load_library_from_apk) { | 1702         if (_load_library_from_apk) { | 
| 1708           defines += [ "ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE" ] | 1703           defines += [ "ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE" ] | 
| 1709         } | 1704         } | 
| 1710         if (_enable_chromium_linker_tests) { | 1705         if (_enable_chromium_linker_tests) { | 
| 1711           defines += [ "ENABLE_CHROMIUM_LINKER_TESTS" ] | 1706           defines += [ "ENABLE_CHROMIUM_LINKER_TESTS" ] | 
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2750         # because in practice they seem to contain classes required to be in the | 2745         # because in practice they seem to contain classes required to be in the | 
| 2751         # classpath. | 2746         # classpath. | 
| 2752         deps += _subjar_targets | 2747         deps += _subjar_targets | 
| 2753       } | 2748       } | 
| 2754       if (defined(_res_target_name)) { | 2749       if (defined(_res_target_name)) { | 
| 2755         deps += [ ":$_res_target_name" ] | 2750         deps += [ ":$_res_target_name" ] | 
| 2756       } | 2751       } | 
| 2757     } | 2752     } | 
| 2758   } | 2753   } | 
| 2759 } | 2754 } | 
| OLD | NEW | 
|---|