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

Side by Side Diff: templates/BUILD.gn.template

Issue 2214453002: Update BUILD.gn template (Closed) Base URL: https://chromium.googlesource.com/external/github.com/grpc/grpc@2016-07-27
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 unified diff | Download patch
« BUILD.gn ('K') | « BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 config("grpc_config") { 8 config("grpc_config") {
9 include_dirs = [ 9 include_dirs = [
10 ".", 10 ".",
(...skipping 18 matching lines...) Expand all
29 deps = [ 29 deps = [
30 "//third_party/boringssl", 30 "//third_party/boringssl",
31 ] 31 ]
32 32
33 if target_dict.get("build", None) == "protoc": 33 if target_dict.get("build", None) == "protoc":
34 deps.append("//third_party/protobuf:protoc_lib") 34 deps.append("//third_party/protobuf:protoc_lib")
35 35
36 name = target_dict.get("name", None) 36 name = target_dict.get("name", None)
37 if name in ("grpc++_unsecure", "grpc++", "grpc++_codegen_lib"): 37 if name in ("grpc++_unsecure", "grpc++", "grpc++_codegen_lib"):
38 deps.append("//third_party/protobuf:protobuf_lite") 38 deps.append("//third_party/protobuf:protobuf_lite")
39 elif name == "grpc": 39 elif name in ("grpc", "grpc_unsecure"):
40 deps.append("//third_party/zlib") 40 deps.append("//third_party/zlib")
41 41
42 for d in target_dict.get("deps", []): 42 for d in target_dict.get("deps", []):
43 if d.startswith(("//", ":")): 43 if d.startswith(("//", ":")):
44 deps.append(d) 44 deps.append(d)
45 else: 45 else:
46 deps.append(":%s" % d) 46 deps.append(":%s" % d)
47 return deps 47 return deps
48 48
49 def get_extra_configs(target_dict): 49 def get_extra_configs(target_dict):
50 if target_dict.get("name", "") == "grpc_cpp_plugin":
51 return ["//third_party/protobuf:protobuf_config"]
52 return []
53
54 def get_extra_public_configs(target_dict):
50 if target_dict.get("name", "") in ("grpc++", "grpc++_unsecure"): 55 if target_dict.get("name", "") in ("grpc++", "grpc++_unsecure"):
51 return [":grpc_no_cxx11_threads"] 56 return [":grpc_no_cxx11_threads"]
52 if target_dict.get("name", "") == "grpc_cpp_plugin":
53 return ["//third_party/protobuf:protobuf_config"]
54 return [] 57 return []
55 58
56 def uses_nanopb_or_protofull(f): 59 def uses_nanopb_or_protofull(f):
57 return (f.startswith("third_party/nanopb") 60 return (f.startswith("third_party/nanopb")
58 or f.endswith(".pb.h") 61 or f.endswith(".pb.h")
59 or f.endswith(".pb.c") 62 or f.endswith(".pb.c")
60 or f.endswith(".pb.cc") 63 or f.endswith(".pb.cc")
61 or f.endswith("load_balancer_api.h") 64 or f.endswith("load_balancer_api.h")
62 or f.endswith("load_balancer_api.c")) 65 or f.endswith("load_balancer_api.c"))
63 66
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 "${dep}", 110 "${dep}",
108 % endfor 111 % endfor
109 ] 112 ]
110 configs -= [ "//build/config/compiler:chromium_code" ] 113 configs -= [ "//build/config/compiler:chromium_code" ]
111 configs += [ 114 configs += [
112 "//build/config/compiler:no_chromium_code", 115 "//build/config/compiler:no_chromium_code",
113 % for config in get_extra_configs(lib): 116 % for config in get_extra_configs(lib):
114 "${config}", 117 "${config}",
115 % endfor 118 % endfor
116 ] 119 ]
117 public_configs = [ ":grpc_config" ] 120 public_configs = [
121 ":grpc_config",
122 % for config in get_extra_public_configs(lib):
123 "${config}",
124 % endfor
125 ]
118 } 126 }
119 </%def> 127 </%def>
120 128
121 <%def name="cc_binary(tgt)"> 129 <%def name="cc_binary(tgt)">
122 executable("${tgt.name}") { 130 executable("${tgt.name}") {
123 sources = [ 131 sources = [
124 % for src in tgt.src: 132 % for src in tgt.src:
125 "${src}", 133 "${src}",
126 % endfor 134 % endfor
127 ] 135 ]
128 deps = [ 136 deps = [
129 % for dep in get_deps(tgt): 137 % for dep in get_deps(tgt):
130 "${dep}", 138 "${dep}",
131 % endfor 139 % endfor
132 ] 140 ]
133 configs -= [ "//build/config/compiler:chromium_code" ] 141 configs -= [ "//build/config/compiler:chromium_code" ]
134 configs += [ 142 configs += [
135 "//build/config/compiler:no_chromium_code", 143 "//build/config/compiler:no_chromium_code",
136 % for config in get_extra_configs(tgt): 144 % for config in get_extra_configs(tgt):
137 "${config}", 145 "${config}",
138 % endfor 146 % endfor
139 ] 147 ]
140 public_configs = [ ":grpc_config" ] 148 public_configs = [ ":grpc_config" ]
141 } 149 }
142 </%def> 150 </%def>
OLDNEW
« BUILD.gn ('K') | « BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698