[CMake] CMake configuration times with Microsoft Visual C++
Bill Hoffman
bill.hoffman at kitware.com
Tue Mar 6 21:45:11 EST 2012
On 3/6/2012 9:09 PM, Clifford Yapp wrote:
> We use the same configuration tests on all platforms in an effort to
> avoid having large chunks of platform-specific code in our build files,
> but we pay a price for this on Windows - the same test process is more
> than an order of magnitude slower with MSVC than (say) Linux.
>
> Does CMake launch the MSVC C++ compiler each time it needs to do a
> TRY_COMPILE or similar test? If so, does anybody know of any techniques
> for combining tests or some way to run a cl.exe instance as a "daemon"
> to which multiple files can be fed without needing a full restart of cl.exe?
>
No, good way to do this on windows. The best you can do is to make sure
it tries the windows stuff first, and that you remove as many
try-compiles as possible when on Windows. Not only does CMake launch
cl.exe, but it will also launch devenv.com with command line build
arguments.... :) It is the only way to make sure that the compile
environments are exact. So, you can optimize a build for windows with a
bit of work, but there is nothing easy to do from CMake to make this faster.
-Bill
More information about the CMake
mailing list