| OLD | NEW |
| 1 %YAML 1.2 | 1 %YAML 1.2 |
| 2 --- | | 2 --- | |
| 3 # GRPC Chromium BUILD.gn file. | 3 # GRPC Chromium BUILD.gn file. |
| 4 # This file has been automatically generated from a template file. | 4 # This file has been automatically generated from a template file. |
| 5 # Please look at the templates directory instead. | 5 # Please look at the templates directory instead. |
| 6 # This file can be regenerated from the template by running | 6 # This file can be regenerated from the template by running |
| 7 # tools/buildgen/generate_projects.sh | 7 # tools/buildgen/generate_projects.sh |
| 8 if (is_android) { | 8 if (is_android) { |
| 9 import("//build/config/android/config.gni") | 9 import("//build/config/android/config.gni") |
| 10 import("//build/config/android/rules.gni") | 10 import("//build/config/android/rules.gni") |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 wanted_libs = ("gpr", "grpc", "grpc_unsecure", "grpc++", "grpc++_unsecure", | 80 wanted_libs = ("gpr", "grpc", "grpc_unsecure", "grpc++", "grpc++_unsecure", |
| 81 "grpc_cronet", "grpc_plugin_support") | 81 "grpc_cronet", "grpc_plugin_support") |
| 82 return lib.build in ("all", "protoc") and lib.get("name", "") in wanted_libs | 82 return lib.build in ("all", "protoc") and lib.get("name", "") in wanted_libs |
| 83 | 83 |
| 84 def wanted_binary(tgt): | 84 def wanted_binary(tgt): |
| 85 wanted_binaries = ("grpc_cpp_plugin",) | 85 wanted_binaries = ("grpc_cpp_plugin",) |
| 86 return tgt.build == "protoc" and tgt.get("name", "") in wanted_binaries | 86 return tgt.build == "protoc" and tgt.get("name", "") in wanted_binaries |
| 87 | 87 |
| 88 def only_on_host_toolchain(tgt): | 88 def only_on_host_toolchain(tgt): |
| 89 return tgt.get("name", "") in ("grpc_plugin_support", "grpc_cpp_plugin") | 89 return tgt.get("name", "") in ("grpc_plugin_support", "grpc_cpp_plugin") |
| 90 |
| 91 def contains_wrap_memcpy(srcs): |
| 92 for src in srcs: |
| 93 if 'wrap_memcpy' in src: |
| 94 return True |
| 95 return False |
| 96 |
| 97 def get_wrap_memcpy(srcs): |
| 98 return [s for s in srcs if "wrap_memcpy" in s] |
| 90 %> | 99 %> |
| 91 | 100 |
| 92 % for lib in libs: | 101 % for lib in libs: |
| 93 % if wanted_lib(lib): | 102 % if wanted_lib(lib): |
| 94 % if only_on_host_toolchain(lib): | 103 % if only_on_host_toolchain(lib): |
| 95 # Only compile the plugin for the host architecture. | 104 # Only compile the plugin for the host architecture. |
| 96 if (current_toolchain == host_toolchain) { | 105 if (current_toolchain == host_toolchain) { |
| 97 ${cc_library(lib)} | 106 ${cc_library(lib)} |
| 98 } | 107 } |
| 99 % else: | 108 % else: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 127 % for hdr in lib.get("public_headers", []): | 136 % for hdr in lib.get("public_headers", []): |
| 128 "${hdr}", | 137 "${hdr}", |
| 129 % endfor | 138 % endfor |
| 130 % for hdr in hdrs: | 139 % for hdr in hdrs: |
| 131 "${hdr}", | 140 "${hdr}", |
| 132 % endfor | 141 % endfor |
| 133 % for src in srcs: | 142 % for src in srcs: |
| 134 "${src}", | 143 "${src}", |
| 135 % endfor | 144 % endfor |
| 136 ] | 145 ] |
| 146 % if contains_wrap_memcpy(srcs): |
| 147 if (is_android) { |
| 148 # gRPC memcpy wrapping logic isn't Android-friendly. |
| 149 # See https://crbug.com/661171 |
| 150 sources -= [ |
| 151 % for src in get_wrap_memcpy(srcs): |
| 152 "${src}", |
| 153 % endfor |
| 154 ] |
| 155 } |
| 156 % endif |
| 137 deps = [ | 157 deps = [ |
| 138 % for dep in get_deps(lib): | 158 % for dep in get_deps(lib): |
| 139 "${dep}", | 159 "${dep}", |
| 140 % endfor | 160 % endfor |
| 141 ] | 161 ] |
| 142 configs -= [ "//build/config/compiler:chromium_code" ] | 162 configs -= [ "//build/config/compiler:chromium_code" ] |
| 143 configs += [ | 163 configs += [ |
| 144 "//build/config/compiler:no_chromium_code", | 164 "//build/config/compiler:no_chromium_code", |
| 145 % for config in get_extra_configs(lib): | 165 % for config in get_extra_configs(lib): |
| 146 "${config}", | 166 "${config}", |
| (...skipping 20 matching lines...) Expand all Loading... |
| 167 configs -= [ "//build/config/compiler:chromium_code" ] | 187 configs -= [ "//build/config/compiler:chromium_code" ] |
| 168 configs += [ | 188 configs += [ |
| 169 "//build/config/compiler:no_chromium_code", | 189 "//build/config/compiler:no_chromium_code", |
| 170 % for config in get_extra_configs(tgt): | 190 % for config in get_extra_configs(tgt): |
| 171 "${config}", | 191 "${config}", |
| 172 % endfor | 192 % endfor |
| 173 ] | 193 ] |
| 174 public_configs = [ ":grpc_config" ] | 194 public_configs = [ ":grpc_config" ] |
| 175 } | 195 } |
| 176 </%def> | 196 </%def> |
| OLD | NEW |