top | item 35843786

(no title)

simplotek | 2 years ago

> I hadn't considered it as a build speed optimization, though that seems somewhat obvious in hindsight.

Some build systems like cmake already support unity builds, as this is a popular strategy to speed up builds.

Nevertheless, if speed is the main concern them it's preferable to just use a build cache like ccache, and modularize a project appropriately.

discuss

order

maccard|2 years ago

Why not both?

Also, does ccache work with MSVC?

simplotek|2 years ago

> Also, does ccache work with MSVC?

Technically it works, but it requires some work. You need to pass off ccache's executable as the target compiler, and you need to configure the settings in all vsproj files to allow calls to the compiler to be cacheable, like disabling compilation batching.

Using cmake to generate make/ninja projects and use compilers other than msvc is far simpler and straight-forward: set two cmake vars and you're done.