Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does ninja detect which files to rebuild?

I have a directory containing a repo and a build folder. The build folder contains the complete build of objects, as triggered using ninja. I want thousands of copies of this directory where just one source file will be different between copies. I'm hoping to use ninja on these copied directories, triggering an incremental, rather than complete build, making the build much faster. However, running ninja in a copied directory, even with no changes applied, performs a total rebuild. The copied directory already contains all of the built objects so this is wasteful.

How does ninja detect which files have to be rebuilt and how might I go about changing the copied directory to avoid the full rebuild?

like image 460
Phlox Midas Avatar asked Sep 01 '25 11:09

Phlox Midas


1 Answers

Turns out the timestamps of copies have to be the same too. I was using cp -r source dest but I should have added the flag to copy timestamps: cp -rp source dest.

like image 51
Phlox Midas Avatar answered Sep 04 '25 09:09

Phlox Midas