eProsima / Fast-DDS-Gen

Fast-DDS IDL code generator tool. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
80 stars 59 forks source link

C++: Incorrect C++ includes generated for IDLs which include enum-only IDLs #215

Closed clunietp closed 1 year ago

clunietp commented 1 year ago

Consider the following:

MyEnums.idl:

module foo {
    enum Bar {
        SOME_VALUE
    }
}

MyMessage.idl:

#include "MyEnums.idl"
module foo {
    struct MyMessage {
            foo::Bar myValue;
    }
}

Using Fast-DDS-Gen v2.5 (omitting -o option) results in the following cpp code for MyMessage.idl:

...
#include "MyEnumsPubSubTypes.h"
...

However, because MyEnums.idl only defines enums, the MyEnumsPubSubTypes.h file is never generated by Fast-DDS-Gen, leading to an invalid include directive in the generated cpp file for MyMessage.h (and/or MyMessagePubSubTypes.h; I'm working from memory).

This appears to be a regression in Fast-DDS-Gen v2.5. Version 2.4 is handling this properly.

JLBuenoLopez commented 1 year ago

Thanks for your report, @clunietp

212 fixed the issue you mention in master and it is going to be formally released in the coming weeks. I am going to close the issue as it is already fixed.