Decreasing build time of project that use generated idl files in modern c++

2 posts / 0 new
Last post
Offline
Last seen: 1 week 4 days ago
Joined: 09/10/2022
Posts: 45
Decreasing build time of project that use generated idl files in modern c++

I use rti dds version 6.0.0, in modern c++ language.
I use about three hundred struct (two hundred of them used as topic), and tens enums that used in structs.
When I generate idl file with rtiddsgen, generator converts idl file to thens of thousand line of c++ code in four file:
file.cxx file.hpp filePlugin.cxx filePlugin.cxx
I use CMAKE file for building my project. I add some header files to project by add_executable (in projects) or add_library (in libraries).
when I include generated header files to c++ code, Build time increases significantly.
Is there any option for rtiddsgen that decrease size of generated codes and decrease build time of project?
And In general what is the suggestions to decrease build time of rti dds projects?

Howard's picture
Offline
Last seen: 8 hours 14 min ago
Joined: 11/29/2012
Posts: 645

You should use the annotation

@nested

in your .idls for the 100 structs that are not used directly by topics.  This will prevent rtiddsgen from generating non-required code for those structures unnecessarily both shorting the generation time as well as reducing the amount of code being generated.

The other idea is that unless your datatypes, aka, idls are changing all of the time, you should build a library of your data types separately...and only regenerate/rebuild if the idls change.  Otherwise, your applications should just use the prebuilt libraries/header files...and have to regenerate/rebuild from .idl every time you want to compile your application.