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

Unified Diff: mojo/public/tools/bindings/mojom.gni

Issue 1095183003: mojom.gni: add a source set called ${target_name}_cpp_sources. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | 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 1e3bdb621f8e7fda0559a60a156999171dc943a6..e21e28665fc66a0ffb415f86574e155f2613c75e 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -4,9 +4,9 @@
import("../../mojo_sdk.gni")
-# Generate C++ and JavaScript source files from mojom files. The output files
-# will go under the generated file directory tree with the same path as each
-# input file.
+# Generate C++/JavaScript/Java/Python/Dart/Go source files from mojom files. The
+# output files will go under the generated file directory tree with the same
+# path as each input file.
#
# If a mojom target is intended for use in a client repo where the location of
# the Mojo SDK will be different than its location in the Mojo repo,
@@ -212,7 +212,6 @@ template("mojom") {
testonly = invoker.testonly
}
if (defined(invoker.sources)) {
- sources = process_file_template(invoker.sources, generator_cpp_outputs)
data = process_file_template(invoker.sources, generator_js_outputs)
}
@@ -220,6 +219,9 @@ 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 += [ ":${target_name}_cpp_sources" ]
+ }
public_deps += rebased_mojo_sdk_public_deps
if (defined(invoker.public_deps)) {
public_deps += invoker.public_deps
@@ -353,6 +355,24 @@ template("mojom") {
}
}
+ if (defined(invoker.sources)) {
+ # The generated C++ source files. The main reason to introduce this target
+ # is so that mojo/public/cpp/bindings can depend on mojom interfaces without
+ # circular dependencies.
+ source_set("${target_name}_cpp_sources") {
+ if (defined(invoker.visibility)) {
+ visibility = target_visibility + invoker.visibility
+ }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ sources = process_file_template(invoker.sources, generator_cpp_outputs)
+ public_configs =
+ rebase_path([ "mojo/public/build/config:mojo_sdk" ], ".", mojo_root)
+ deps = [ ":$generator_target_name" ]
+ }
+ }
+
if (is_android) {
import("//build/config/android/rules.gni")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698