[CMake] relinking

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Jun 27 11:36:04 EDT 2007


On 2007-06-27 08:18-0600 James Bigler wrote:

> In general, I've been more happy avoiding circular library dependencies than 
> trying to support them.  Some operating systems can get really cranky trying 
> to do this.

I agree. Circular library dependencies are nothing but a headache so my
advice is to always avoid them. You can do that by the giant library method
already mentioned or by careful refactoring of your source code
files/reorganization of your libraries.  Another alternative is to find the
minimal additional source files that should be compiled into more than one
of your libraries to break the circular dependency chain. Once you have
identified those source files that need to be compiled into more than one of
your libraries, CMake can do the builds automatically with no need for any
special relinking, temporary libraries, etc. The only drawback to this
method is some of your source files will be compiled for more than one of
your libraries, but to my mind that is a small price to pay to get rid of
all circular library dependencies and is a good compromise if you don't want
to use a giant library or go to the bother of code refactoring.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.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