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

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: address comments from previous patch 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
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..90031813959ddae9bba5547c58b14e547e613a84 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -202,6 +202,30 @@ 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 = rebased_mojo_sdk_deps
+ 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 +241,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}_data_only") {
+ 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
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698