aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRisan <risan@google.com>2018-02-07 03:39:05 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-02-07 03:39:05 +0000
commit8226c53f4667edce79b56431b47925f0d568942e (patch)
tree0339bd6f305755f0299fe3a9b09a8fbd4b7ccb9a
parent5f197e61f4a2818c3813023d10c931b13dc60a1b (diff)
parent15b821c15a65fc40c5c166f0a3e8cfbd9f0a6f4c (diff)
downloadlibmojo-8226c53f4667edce79b56431b47925f0d568942e.tar.gz
Add libmojo to mojo_binding import search dir am: 1db26454cf am: 7c5f10c51b
am: 15b821c15a Change-Id: I9a4056425150ffa3520262f28cb7cd3423eaeb97
-rwxr-xr-xsoong/mojom_source_generator.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/soong/mojom_source_generator.sh b/soong/mojom_source_generator.sh
index bf78fab..f1fac9e 100755
--- a/soong/mojom_source_generator.sh
+++ b/soong/mojom_source_generator.sh
@@ -28,6 +28,7 @@ mojom_bindings_generator=""
package=""
output_dir=""
generators=""
+private_mojo_root="$(pwd)/external/libmojo"
# Given a path to directory or file, return the absolute path.
get_abs_path() {
@@ -90,12 +91,18 @@ for file in "${files[@]}"; do
mkdir -p "${output_dir}/${rel_dir}"
+ # The calls to mojom_bindings_generator below uses -I option to include the
+ # libmojo root directory as part of searchable directory for imports. With
+ # this, we can have a mojo file located in some arbitrary directories that
+ # imports a mojo file under external/libmojo.
"${mojom_bindings_generator}" generate -o "${output_dir}" "${args[@]}" \
--bytecode_path="${bytecode_path}" \
+ -I "${private_mojo_root}:${private_mojo_root}" \
--generators=${generators} "${file}"
if [[ "${generators}" =~ .*c\+\+.* ]] ; then
"${mojom_bindings_generator}" generate -o "${output_dir}" \
--generate_non_variant_code "${args[@]}" \
+ -I "${private_mojo_root}:${private_mojo_root}" \
--bytecode_path="${bytecode_path}" --generators=${generators} \
"${file}"
fi