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

Alan W. Irwin Alan.W.Irwin1234 at gmail.com
Mon Oct 14 16:03:39 EDT 2019


On 2019-10-13 17:15-0400 Paul Smith wrote:

> 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.

I agree that it is not at all clear whether this is the cause of the
issue.  So I will stop speculating about that cause even though that
is a fun activity.  :-)

Nevertheless, it does sound like your complex test case does expose
some issue with EITHER how you have implemented the build system for
your complex case OR how CMake currently rejects certain builds from
being included in Unity builds.  So to figure out which it is, I think
your next step should be to attempt to implement the simplest possible
self-contained test case that illustrates the Unity exclusion issue
you have found.

I believe that course has already been suggested in this thread so I
am seconding that motion.  My own experiences with such
implementations is I often cannot demonstrate the issue in a simple
way, i.e., the "CMake bug" often tends to be due to an issue with my
implementation of the build system for the complex case.  However, when
I have demonstrated with such a simple test case there really is a
CMake bug, that test case normally helps CMake developers in a big way
to find and fix the issue.

Alan
__________________________
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.org); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list