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

Unified Diff: templates/BUILD.gn.template

Issue 2260573003: Fix build rules for gRPC proto generator plugin to work when crosscompiling (Closed) Base URL: https://chromium.googlesource.com/external/github.com/grpc/grpc@2016-08-17
Patch Set: Created 4 years, 4 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
« no previous file with comments | « BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: templates/BUILD.gn.template
diff --git a/templates/BUILD.gn.template b/templates/BUILD.gn.template
index 2e3cc221df3ee0d051d748bc8ebfc969c4c3ca0b..ece389410da3fab6a1c3d3aac43eb115474fe10c 100644
--- a/templates/BUILD.gn.template
+++ b/templates/BUILD.gn.template
@@ -74,18 +74,35 @@
def wanted_binary(tgt):
wanted_binaries = ("grpc_cpp_plugin",)
return tgt.build == "protoc" and tgt.get("name", "") in wanted_binaries
+
+ def only_on_host_toolchain(tgt):
+ return tgt.get("name", "") in ("grpc_plugin_support", "grpc_cpp_plugin")
%>
% for lib in libs:
% if wanted_lib(lib):
+ % if only_on_host_toolchain(lib):
+ # Only compile the plugin for the host architecture.
+ if (current_toolchain == host_toolchain) {
+ ${cc_library(lib)}
+ }
+ % else:
${cc_library(lib)}
% endif
+ % endif
% endfor
% for tgt in targets:
% if wanted_binary(tgt):
+ % if only_on_host_toolchain(tgt):
+ # Only compile the plugin for the host architecture.
+ if (current_toolchain == host_toolchain) {
${cc_binary(tgt)}
+ }
+ % else:
+ ${cc_binary(tgt)}
+ % endif
% endif
% endfor
« no previous file with comments | « BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698