[CMake] Unity builds (was: Re: [ANNOUNCE] CMake 3.16.0-rc1 is ready for testing)

Paul Smith paul at mad-scientist.net
Sun Oct 13 17:15:04 EDT 2019


On Sat, 2019-10-12 at 19:25 -0700, Alan W. Irwin wrote:
> > Virtually all my properties are set on a per-target basis, so I assumed
> > they wouldn't be an issue here.
> > 
> > Am I misunderstanding that?
> 
> I think the current documentation is ambiguous about this.  But
> certain target and directory properties can affect the flags used to
> compile the source code just as much as source code properties.  So I
> am virtually positive the implementation has to pay attention to all
> these sources of properties to decide what can/cannot be lumped into a
> Unity source file.  If Kyle confirms this guess, then the
> documentation should be changed accordingly to remove the ambiguity
> about this.

I know no more than you but I'm quite sure that it's not the case that
adding library/executable-level options can cause unity to be disabled.
I've never heard of _ANY_ such target that didn't have at least some
properties defined for it.

A unity source file can lump together N real source files from the same
target (library/executable) as long as those files don't have extra
source-specific flags, because all other files in a given target have
the same flags.



More information about the CMake mailing list