aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRisan <risan@google.com>2018-02-05 17:09:01 +0900
committerRisan <risan@google.com>2018-02-07 03:10:56 +0900
commit1db26454cf100fc964aa64963e42edda61000cd8 (patch)
tree0339bd6f305755f0299fe3a9b09a8fbd4b7ccb9a
parent7db3d20fd6c3c29cc8fc1f9fded774ea84e7cd16 (diff)
downloadlibmojo-1db26454cf100fc964aa64963e42edda61000cd8.tar.gz
Add libmojo to mojo_binding import search dir
This CL dispels the black magic previously used to link generated mojo sources/headers to external/libmojo. This allows ag/3559847. Bug: 72927715 Test: Compiled. Change-Id: I31cf7a510615c064370ed53ff55c10d76942e75b
-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