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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/mojom.gni
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni
index 0c0f294c5c5d5ad5ca8a7b08e48a52dae8f155a2..74ffb38f6ce48231529b05ae6a909d9df0cc30c5 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -202,6 +202,31 @@ template("mojom") {
}
}
+ # Some re-usable variables for the C++ source sets:
+ cpp_public_deps = []
+ if (defined(invoker.sources)) {
+ cpp_public_deps += [ ":${cpp_sources_target_name}" ]
+ }
+ cpp_public_deps += rebased_mojo_sdk_public_deps
+ if (defined(invoker.public_deps)) {
+ cpp_public_deps += invoker.public_deps
+ }
+ if (defined(invoker.sources)) {
+ cpp_public_deps += [ ":$generator_target_name" ]
+ }
+ cpp_deps = []
+ 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.
+ if (defined(invoker.deps)) {
+ cpp_deps += invoker.deps
+ }
+ if (defined(invoker.mojo_sdk_deps)) {
+ foreach(sdk_dep, invoker.mojo_sdk_deps) {
+ # Check that the SDK dep was not mistakenly given as an absolute path.
+ assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
+ cpp_deps += [ rebase_path(sdk_dep, ".", mojo_root) ]
+ }
+ }
+
source_set(target_name) {
if (defined(invoker.visibility)) {
visibility = invoker.visibility
@@ -217,29 +242,30 @@ template("mojom") {
rebase_path([ "mojo/public/build/config:mojo_sdk" ], ".", mojo_root)
public_deps = rebase_path([ "mojo/public/cpp/bindings" ], ".", mojo_root)
- if (defined(invoker.sources)) {
- public_deps += [ ":${cpp_sources_target_name}" ]
- }
- public_deps += rebased_mojo_sdk_public_deps
- if (defined(invoker.public_deps)) {
- public_deps += invoker.public_deps
- }
+ public_deps += cpp_public_deps
- deps = []
- if (defined(invoker.sources)) {
- public_deps += [ ":$generator_target_name" ]
+ deps = cpp_deps
+ }
+
+ 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.
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
}
- deps += rebased_mojo_sdk_deps
- if (defined(invoker.deps)) {
- deps += invoker.deps
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
}
- if (defined(invoker.mojo_sdk_deps)) {
- foreach(sdk_dep, invoker.mojo_sdk_deps) {
- # Check that the SDK dep was not mistakenly given as an absolute path.
- assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
- deps += [ rebase_path(sdk_dep, ".", mojo_root) ]
- }
+ if (defined(invoker.sources)) {
+ data = process_file_template(invoker.sources, generator_js_outputs)
}
+
+ public_configs =
+ rebase_path([ "mojo/public/build/config:mojo_sdk" ], ".", mojo_root)
+
+ public_deps = rebase_path([ "mojo/public/cpp/bindings:serialization" ],
+ ".",
+ mojo_root)
+ public_deps += cpp_public_deps
+ deps = cpp_deps
}
all_deps = rebased_mojo_sdk_deps + rebased_mojo_sdk_public_deps

Powered by Google App Engine
This is Rietveld 408576698