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

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

Issue 1412733002: C++ bindings: separate out serialization source set, have "mojom" targets optionally use serializat… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: link sanitizer to examples/serialization (to fix the ASAN build failure) Created 5 years, 2 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 import("../../mojo_sdk.gni") 5 import("../../mojo_sdk.gni")
6 6
7 # Generate C++/JavaScript/Java/Python/Dart/Go source files from mojom files. The 7 # Generate C++/JavaScript/Java/Python/Dart/Go source files from mojom files. The
8 # output files will go under the generated file directory tree with the same 8 # output files will go under the generated file directory tree with the same
9 # path as each input file. 9 # path as each input file.
10 # 10 #
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 foreach(import_dir, invoker.import_dirs) { 195 foreach(import_dir, invoker.import_dirs) {
196 args += [ 196 args += [
197 "-I", 197 "-I",
198 rebase_path(import_dir, root_build_dir), 198 rebase_path(import_dir, root_build_dir),
199 ] 199 ]
200 } 200 }
201 } 201 }
202 } 202 }
203 } 203 }
204 204
205 # Some re-usable variables for the C++ source sets:
206 cpp_public_deps = []
207 if (defined(invoker.sources)) {
208 cpp_public_deps += [ ":${cpp_sources_target_name}" ]
209 }
210 cpp_public_deps += rebased_mojo_sdk_public_deps
211 if (defined(invoker.public_deps)) {
212 cpp_public_deps += invoker.public_deps
213 }
214 if (defined(invoker.sources)) {
215 cpp_public_deps += [ ":$generator_target_name" ]
216 }
217 cpp_deps = []
218 cpp_deps += rebased_mojo_sdk_deps
jamesr 2015/10/21 00:24:56 = [] += ... isn't needed, you can just say cpp_d
vardhan 2015/10/21 19:29:38 Done.
219 if (defined(invoker.deps)) {
220 cpp_deps += invoker.deps
221 }
222 if (defined(invoker.mojo_sdk_deps)) {
223 foreach(sdk_dep, invoker.mojo_sdk_deps) {
224 # Check that the SDK dep was not mistakenly given as an absolute path.
225 assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
226 cpp_deps += [ rebase_path(sdk_dep, ".", mojo_root) ]
227 }
228 }
229
205 source_set(target_name) { 230 source_set(target_name) {
206 if (defined(invoker.visibility)) { 231 if (defined(invoker.visibility)) {
207 visibility = invoker.visibility 232 visibility = invoker.visibility
208 } 233 }
209 if (defined(invoker.testonly)) { 234 if (defined(invoker.testonly)) {
210 testonly = invoker.testonly 235 testonly = invoker.testonly
211 } 236 }
212 if (defined(invoker.sources)) { 237 if (defined(invoker.sources)) {
213 data = process_file_template(invoker.sources, generator_js_outputs) 238 data = process_file_template(invoker.sources, generator_js_outputs)
214 } 239 }
215 240
216 public_configs = 241 public_configs =
217 rebase_path([ "mojo/public/build/config:mojo_sdk" ], ".", mojo_root) 242 rebase_path([ "mojo/public/build/config:mojo_sdk" ], ".", mojo_root)
218 243
219 public_deps = rebase_path([ "mojo/public/cpp/bindings" ], ".", mojo_root) 244 public_deps = rebase_path([ "mojo/public/cpp/bindings" ], ".", mojo_root)
245 public_deps += cpp_public_deps
246
247 deps = cpp_deps
248 }
249
250 source_set("${target_name}_dataonly") {
viettrungluu 2015/10/20 23:54:37 Maybe "_data_only" would look nicer?
jamesr 2015/10/21 00:24:56 +1
vardhan 2015/10/21 19:29:38 Done.
251 if (defined(invoker.visibility)) {
252 visibility = invoker.visibility
253 }
254 if (defined(invoker.testonly)) {
255 testonly = invoker.testonly
256 }
220 if (defined(invoker.sources)) { 257 if (defined(invoker.sources)) {
221 public_deps += [ ":${cpp_sources_target_name}" ] 258 data = process_file_template(invoker.sources, generator_js_outputs)
222 }
223 public_deps += rebased_mojo_sdk_public_deps
224 if (defined(invoker.public_deps)) {
225 public_deps += invoker.public_deps
226 } 259 }
227 260
228 deps = [] 261 public_configs =
229 if (defined(invoker.sources)) { 262 rebase_path([ "mojo/public/build/config:mojo_sdk" ], ".", mojo_root)
230 public_deps += [ ":$generator_target_name" ] 263
231 } 264 public_deps = rebase_path([ "mojo/public/cpp/bindings:serialization" ],
232 deps += rebased_mojo_sdk_deps 265 ".",
233 if (defined(invoker.deps)) { 266 mojo_root)
234 deps += invoker.deps 267 public_deps += cpp_public_deps
235 } 268 deps = cpp_deps
236 if (defined(invoker.mojo_sdk_deps)) {
237 foreach(sdk_dep, invoker.mojo_sdk_deps) {
238 # Check that the SDK dep was not mistakenly given as an absolute path.
239 assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
240 deps += [ rebase_path(sdk_dep, ".", mojo_root) ]
241 }
242 }
243 } 269 }
244 270
245 all_deps = rebased_mojo_sdk_deps + rebased_mojo_sdk_public_deps 271 all_deps = rebased_mojo_sdk_deps + rebased_mojo_sdk_public_deps
246 if (defined(invoker.deps)) { 272 if (defined(invoker.deps)) {
247 all_deps += invoker.deps 273 all_deps += invoker.deps
248 } 274 }
249 if (defined(invoker.public_deps)) { 275 if (defined(invoker.public_deps)) {
250 all_deps += invoker.public_deps 276 all_deps += invoker.public_deps
251 } 277 }
252 278
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 # //mojo/something:something and we can append "_java" to get the java 399 # //mojo/something:something and we can append "_java" to get the java
374 # dependency name. 400 # dependency name.
375 full_name = get_label_info(d, "label_no_toolchain") 401 full_name = get_label_info(d, "label_no_toolchain")
376 deps += [ "${full_name}_java" ] 402 deps += [ "${full_name}_java" ]
377 } 403 }
378 404
379 srcjar_deps = [ ":$java_srcjar_target_name" ] 405 srcjar_deps = [ ":$java_srcjar_target_name" ]
380 } 406 }
381 } 407 }
382 } 408 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698