Question

In my (primarily C++) development, I have long adhered to using out-of-source builds. That is, my source usually sits in a /project/src directory and the builds live in a /project/build/bin/release, /project/build/bin/debug directories. I have done this because it keeps my source directories clean from intermediate files, I have one location for all of my binaries, packaging is easier, cleaning is easier, and version control is easier. (Did I miss anything?)

I am inheriting a (large) project now that uses in-source builds. What is the motivation for this type of structure and what are its advantages? (I am most concerned with engineering-level reasons vs. personal preference types of reasons.)

I was hoping Lakos' "Large-Scale C++ Software Design" would have weighed in on it, but I missed it if it did.

Was it helpful?

Solution

After asking the community here and continuing my search online, I have not been able to find significant engineering justification for using in-source builds. (There are many examples of reasons to avoid them.)

The only objective reason I have found (as alluded to in the comment by @BartvanIngenSchenau) is that in-source builds are sometimes defaulted to by a build system. Because of this default, they require no overhead in setup time, which may be perfectly acceptable for a very small (or scratch) project.

Licensed under: CC-BY-SA with attribution
scroll top