[CMake] Joining multiple directories into one

Brad King brad.king at kitware.com
Tue Mar 10 09:01:40 EDT 2009


Jussi Pakkanen wrote:
> On Mon, Mar 9, 2009 at 4:03 PM, Brad King <brad.king at kitware.com> wrote:
>> do not perform very well in the VS IDE (this is not CMake, but the VS
>> IDE implementation).  The definitions will work, but they cause the IDE
>> to use a separate invocation of the compiler for every source file
>> instead of sharing one invocation for many sources in a target, which
>> leads to slower builds.
> 
> There are two distinct settings so in theory two compiler invocations
> should be enough.

Unfortunately VS is not that smart.  As soon as the project file contains
any per-source configuration settings it will launch compilation of that
source in its own process.

 > I think that the current build system spawns a new
> compiler process for every file (it is a custom thing based on Perl
> and dmake) so this should not produce any additional penalty.

The difference is that VS will do it without parallelism within a target.
They don't usually need it because typical projects share settings among
all sources and compile them all in one process.  Parallelism only exists
across targets (more than one independent target at once).

Again, this is only in the VS IDE project files.  CMake's Makefile generator
produces highly parallel systems.  Avoiding per-source flags is still
cleaner though.

-Brad


More information about the CMake mailing list