2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-24 02:05:12 +01:00

protoc: add .proto dependencies also in include path otherwise protoc will fail if dependency is in another directory

This commit is contained in:
fedepell 2018-03-22 09:26:30 +01:00 committed by ita1024
parent 8404aa4d5c
commit bb458769ee
3 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,15 @@
package udp.tc.tests;
import "message_inc.proto";
option java_package ="com.udp.tc.tests";
option java_outer_classname= "MessageProtos";
option cc_generic_services = false;
option java_generic_services = false;
option py_generic_services = false;
message Message {
required int32 test = 1;
optional uint32 blah = 2;
required IncludeMe custom = 3;
}

View File

@ -16,8 +16,10 @@ def build(bld):
bld(
features = 'cxx cxxshlib',
source = ['inc/message_inc.proto','inc/message.proto'],
name = 'somelib',
target = 'somelib',
includes = ['inc'])
includes = ['inc'],
export_includes = ['inc'])
bld(
features = 'cxx cxxshlib',
@ -25,6 +27,12 @@ def build(bld):
target = 'somedeeplib',
includes = ['incdeep'])
bld(
features = 'cxx cxxshlib',
source = ['incseparate/depinotherdir.proto'],
target = 'crossdirlib',
includes = ['incseparate'],
use = ['somelib'])
bld(
features = 'py',

View File

@ -124,6 +124,9 @@ class protoc(Task):
names.append(dep)
parse_node(node)
# Add also dependencies path to INCPATHS so protoc will find the included file
for deppath in nodes:
self.env.append_value('INCPATHS', deppath.parent.bldpath())
return (nodes, names)
@extension('.proto')