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

Side by Side Diff: mojo/public/tools/bindings/mojom.gni

Issue 1751563002: Mojo C++ bindings: support mapping mojo string to WTF::String. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync & rebase Created 4 years, 9 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
OLDNEW
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 mojom_generator_root = "//mojo/public/tools/bindings" 5 mojom_generator_root = "//mojo/public/tools/bindings"
6 mojom_generator_script = "$mojom_generator_root/mojom_bindings_generator.py" 6 mojom_generator_script = "$mojom_generator_root/mojom_bindings_generator.py"
7 mojom_generator_sources = [ 7 mojom_generator_sources = [
8 "$mojom_generator_root/generators/mojom_cpp_generator.py", 8 "$mojom_generator_root/generators/mojom_cpp_generator.py",
9 "$mojom_generator_root/generators/mojom_js_generator.py", 9 "$mojom_generator_root/generators/mojom_js_generator.py",
10 "$mojom_generator_root/generators/mojom_java_generator.py", 10 "$mojom_generator_root/generators/mojom_java_generator.py",
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 # typemap_deps (optional) 52 # typemap_deps (optional)
53 # A list of public dependencies needed to support active typemaps. 53 # A list of public dependencies needed to support active typemaps.
54 # 54 #
55 # variant (optional) 55 # variant (optional)
56 # A variant name to apply to generated bindings. Variant influences 56 # A variant name to apply to generated bindings. Variant influences
57 # generated source filenames as wells the symbols they define. 57 # generated source filenames as wells the symbols they define.
58 # 58 #
59 # testonly (optional) 59 # testonly (optional)
60 # 60 #
61 # visibility (optional) 61 # visibility (optional)
62 #
63 # for_blink (optional, C++ only)
64 # Use WTF types as generated type for mojo string/array/map.
62 template("mojom") { 65 template("mojom") {
63 assert( 66 assert(
64 defined(invoker.sources) || defined(invoker.deps) || 67 defined(invoker.sources) || defined(invoker.deps) ||
65 defined(invoker.public_deps), 68 defined(invoker.public_deps),
66 "\"sources\" or \"deps\" must be defined for the $target_name template.") 69 "\"sources\" or \"deps\" must be defined for the $target_name template.")
67 70
68 cpp_sources_suffix = "cpp_sources" 71 cpp_sources_suffix = "cpp_sources"
69 cpp_sources_target_name = "${target_name}_${cpp_sources_suffix}" 72 cpp_sources_target_name = "${target_name}_${cpp_sources_suffix}"
70 cpp_only = false 73 cpp_only = false
71 if (defined(invoker.sources)) { 74 if (defined(invoker.sources)) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 154
152 if (defined(invoker.typemaps)) { 155 if (defined(invoker.typemaps)) {
153 foreach(typemap, invoker.typemaps) { 156 foreach(typemap, invoker.typemaps) {
154 args += [ 157 args += [
155 "--typemap", 158 "--typemap",
156 rebase_path(typemap, root_build_dir), 159 rebase_path(typemap, root_build_dir),
157 ] 160 ]
158 } 161 }
159 inputs += invoker.typemaps 162 inputs += invoker.typemaps
160 } 163 }
164
165 if (defined(invoker.for_blink) && invoker.for_blink) {
166 args += [ "--for_blink" ]
167 }
161 } 168 }
162 } 169 }
163 170
164 source_set(target_name) { 171 source_set(target_name) {
165 if (defined(invoker.visibility)) { 172 if (defined(invoker.visibility)) {
166 visibility = invoker.visibility 173 visibility = invoker.visibility
167 } 174 }
168 if (defined(invoker.testonly)) { 175 if (defined(invoker.testonly)) {
169 testonly = invoker.testonly 176 testonly = invoker.testonly
170 } 177 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (defined(invoker.typemap_deps)) { 245 if (defined(invoker.typemap_deps)) {
239 public_deps += invoker.typemap_deps 246 public_deps += invoker.typemap_deps
240 } 247 }
241 foreach(d, all_deps) { 248 foreach(d, all_deps) {
242 # Resolve the name, so that a target //mojo/something becomes 249 # Resolve the name, so that a target //mojo/something becomes
243 # //mojo/something:something and we can append cpp_sources_suffix to 250 # //mojo/something:something and we can append cpp_sources_suffix to
244 # get the cpp dependency name. 251 # get the cpp dependency name.
245 full_name = get_label_info(d, "label_no_toolchain") 252 full_name = get_label_info(d, "label_no_toolchain")
246 deps += [ "${full_name}_${cpp_sources_suffix}" ] 253 deps += [ "${full_name}_${cpp_sources_suffix}" ]
247 } 254 }
255 if (defined(invoker.for_blink) && invoker.for_blink) {
256 public_deps += [ "//mojo/public/cpp/bindings:wtf_support" ]
257 }
248 } 258 }
249 } 259 }
250 260
251 if (is_android && !defined(invoker.variant)) { 261 if (is_android && !defined(invoker.variant)) {
252 import("//build/config/android/rules.gni") 262 import("//build/config/android/rules.gni")
253 263
254 java_srcjar_target_name = target_name + "_java_sources" 264 java_srcjar_target_name = target_name + "_java_sources"
255 action(java_srcjar_target_name) { 265 action(java_srcjar_target_name) {
256 script = "//mojo/public/tools/gn/zip.py" 266 script = "//mojo/public/tools/gn/zip.py"
257 inputs = process_file_template(invoker.sources, generator_java_outputs) 267 inputs = process_file_template(invoker.sources, generator_java_outputs)
(...skipping 25 matching lines...) Expand all
283 # //mojo/something:something and we can append "_java" to get the java 293 # //mojo/something:something and we can append "_java" to get the java
284 # dependency name. 294 # dependency name.
285 full_name = get_label_info(d, "label_no_toolchain") 295 full_name = get_label_info(d, "label_no_toolchain")
286 deps += [ "${full_name}_java" ] 296 deps += [ "${full_name}_java" ]
287 } 297 }
288 298
289 srcjar_deps = [ ":$java_srcjar_target_name" ] 299 srcjar_deps = [ ":$java_srcjar_target_name" ]
290 } 300 }
291 } 301 }
292 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698