Question

I am trying to generate the C files from my .proto.
I was able to do it but they are generated in the same folder. After this i need to move the .h file into my include directory.
At this moment i am using the ProtoC Builder but there is no option to deliver the .h into a different folder. So i tried to do a Command Move after something like:

proto_files = localenv.Protoc(
    [],
    protoList,
    PROTOCPROTOPATH=[builddir],
    PROTOCPYTHONOUTDIR=None, # set to None to not generate python
    PROTOCOUTDIR = builddir, # defaults to same directory as .proto
    # PROTOCCPPOUTFLAGS = "dllexport_decl=PROTOCONFIG_EXPORT:", too
)
localenv.Command(proto_files[1], proto_files[1],
               [
                Move("$SRC",incFolder+"/$TARGET"),
               ])

but when i run scons i have the following error:

scons: * Two environments with different actions were specified for the same target:

Any idea?

Was it helpful?

Solution

You can't have a Command (or any Builder) with the target and source being the same. How would SCons know whether it was up to date, i.e. whether that builder needs to run or not?

Maybe try:

tgt = localenv.Command(os.path.join(incFolder, proto_files[1]), proto_files[1],
               [
                Move("$SRC","$TARGET"),
               ])

If that doesn't work, please add the full error message (this time include the target name).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top