asm
(Andy)
April 13, 2020, 5:01pm
1
I have a large project with many, many files.
One file takes a very long time to compile - about 2.5 minutes. I don’t have control over that file because it’s a third party dependency.
The build (across cores) looks like this:
With fewer cores, it’s possible this file starts late in the compile which extends the compile time a lot.
So - is there a nice way in cmake to ask it to compile this file as early as possible?
Thanks!
1 Like
ben.boeckel
(Ben Boeckel (Kitware))
April 13, 2020, 5:32pm
2
CMake doesn’t have any (and therefore does not provide any) control over this. With that build output, I assume you’re using the Ninja
generator. In that case, this issue is of interest.
asm
(Andy)
April 13, 2020, 5:45pm
3
Ah - thanks Ben!
I went back-and-forth as to whether this would be a cmake or a ninja thing.
I’ll take a look.
asm
(Andy)
April 16, 2020, 8:44pm
4
In case anyone lands here looking for something similar, I asked the same question over on the ninja repo .
There is an open PR to support this , but it’s old and hasn’t been merged…
Another thing in that PR is pretty cool: on rebuild it uses info from previous builds to adjust the order automatically.