mumble_proto.pro: fix protoc invocation for out-of-tree builds #2830

Merged
merged 1 commit into from Feb 9, 2017

Projects

None yet

2 participants

@davidebeatrici
Member

This fixes the error:

File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).
@davidebeatrici davidebeatrici added the build label Feb 8, 2017
@mkrautz
Member
mkrautz commented Feb 8, 2017

I'm curious... can you paste the full command that protoc invokes, before, and after this change?

I wonder why it's necessary when cross building?

@davidebeatrici
Member

Before: protoc --cpp_out=. -I. -I.. ..\..\..\mumble\src\Mumble.proto
After: protoc --cpp_out=. -I. -I.. -I..\..\..\mumble\src ..\..\..\mumble\src\Mumble.proto

The error didn't appear when cross building, but when using Qt Creator.

@mkrautz
Member
mkrautz commented Feb 9, 2017

Please add a note to the commit summary explaining that this fixes the problem for out-of-tree builds using Qt Creator.

@mkrautz
mkrautz requested changes Feb 9, 2017 edited View changes

Needs clarification in commit message and summary.

mumble_proto.pro: fix protoc invocation for out-of-tree builds.

This fixes the invocation of protoc in mumble_proto.pro to be compatible with out-of-tree builds. For example, this is how Qt Creator builds Mumble by default.

It fixes the error:
<insert the error like you have now>

@mkrautz
Member
mkrautz commented Feb 9, 2017

Please explain why it fails for out-of-tree builds. You don't need the invocation in there -- that was just for me, because I was confused as to how this was related to cross-compiling. (And, as it turned out -- it wasn't).

Something like:

mumble_proto.pro: fix protoc invocation for out-of-tree builds

This fixes the invocation of protoc in mumble_proto.pro to be compatible with out-of-tree builds. For example, this is how Qt Creator builds Mumble by default.

For out-of-tree builds, our include path flags to protoc aren't sufficient. This is because protoc requires that the .proto file it is building is part of the include path. To fix this for out-of-tree builds, we add the absolute path to the directory that contains the .proto file.

This allows protoc to work for out-of-tree builds.

For reference, the error we got (before this commit) from protoc in out-of-tree builds was:
"File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think)."

@davidebeatrici davidebeatrici mumble_proto.pro: fix protoc invocation for out-of-tree builds
This fixes the invocation of protoc in mumble_proto.pro to be compatible with out-of-tree builds. For example, this is how Qt Creator builds Mumble by default.

For out-of-tree builds, our include path flags to protoc aren't sufficient. This is because protoc requires that the .proto file it is building is part of the include path. To fix this for out-of-tree builds, we add the absolute path to the directory that contains the .proto file.

This allows protoc to work for out-of-tree builds.

For reference, the error we got (before this commit) from protoc in out-of-tree builds was:
"File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think)."
00f81cb
@mkrautz mkrautz changed the title from mumble_proto.pro: Fix path to mumble_proto.pro: fix protoc invocation for out-of-tree builds Feb 9, 2017
@mkrautz
mkrautz approved these changes Feb 9, 2017 View changes
@mkrautz mkrautz merged commit 3315e01 into mumble-voip:master Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment