[odb-users] Includes and CMake out-of-source builds

Boris Kolpackov boris at codesynthesis.com
Mon Aug 26 09:05:22 EDT 2013


Hi Per,

Per Edin <info at peredin.com> writes:

> ... except when SLOC_LIMIT is specified. In that case all input files
> are passed to ODB at once. Having the output directory logic in ODB
> itself would allow --sloc-limit / --show-sloc to work while fixing
> the directory/include problem.

One way to work around the SLOC problem is to specify the limit on
the per file basis. For example, GNU make has target-specific 
variables so one could do:

# Total should not exceed 10,000.
#
foo.hxx: sloc_limit := 4000
bar.hxx: sloc_limit := 6000

%-odb.hxx %-odb.ixx %-odb.cxx: %.hxx
	  odb --sloc-limit $(sloc_limit) ...

Or, you could do something like this:

foo_sloc_limit := 4000
bar_sloc_limit := 6000

And then use the file name to form the variable name:

%-odb.hxx %-odb.ixx %-odb.cxx: %.hxx
	  odb --sloc-limit $(value $*_sloc_limit) ...

While not as nice as having a single limit for all the files applied
automatically, I think this is workable.

Boris



More information about the odb-users mailing list