Adrian Herrera has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/55963 )

Change subject: scons: protobuf builder, support source paths
......................................................................

scons: protobuf builder, support source paths

Before this patch, the protobuf builder would search for dependencies
only at the build directory. This works if the importing .proto file
imports paths relative to the build directory, but it results in a build
failure if imports are done relative to the source directory of the
importing file.

This patch adds the source directory of the importing file to the set of
paths searched for dependencies, which solves this issue.

Change-Id: I7debd467485a5087276ac005ac08ab01b32cb02e
Signed-off-by: Adrián Herrera Arcila <adrian.herr...@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55963
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Reviewed-by: Gabe Black <gabe.bl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/SConscript
1 file changed, 26 insertions(+), 1 deletion(-)

Approvals:
Jason Lowe-Power: Looks good to me, but someone else must approve; Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/SConscript b/src/SConscript
index e5b032c..6c8ccaf 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -240,7 +240,8 @@
     return [root + '.pb.cc', root + '.pb.h'], source

 protoc_action = MakeAction('${PROTOC} --cpp_out ${BUILDDIR} '
-        '--proto_path ${BUILDDIR} ${SOURCE.get_abspath()}',
+        '--proto_path ${BUILDDIR} --proto_path ${SOURCE.dir} '
+        '${SOURCE.get_abspath()}',
         Transform("PROTOC"))
 protobuf_builder = Builder(action=protoc_action, emitter=protoc_emitter,
         src_suffix='.proto')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/55963
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I7debd467485a5087276ac005ac08ab01b32cb02e
Gerrit-Change-Number: 55963
Gerrit-PatchSet: 2
Gerrit-Owner: Adrian Herrera <adrian.herr...@arm.com>
Gerrit-Reviewer: Adrian Herrera <adrian.herr...@arm.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to