[llvm-dev] Ninja behavior that befuddles me

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 11 09:01:59 PDT 2020


Before replacing a file, tblgen checks whether its content is identical.
This keeps the time stamps from being updated without any change being made.

The command in add_custom_command is not made a file dependency. The idea
is that the command's input file determines the output file's content, not
the algorithm that does it.

See
https://cmake.org/cmake/help/latest/command/add_custom_command.html#command:add_custom_command

> Whenever a target is used as a command to execute or is mentioned in a
generator expression as a command argument, a target-level dependency will
be added automatically so that the mentioned target will be built before
any target using this custom command. However this does NOT add a
file-level dependency that would cause the custom command to re-run
whenever the executable is recompiled. List target names with the DEPENDS
option to add such file-level dependencies.

Michael








Am Di., 11. Aug. 2020 um 10:39 Uhr schrieb Paul C. Anagnostopoulos via
llvm-dev <llvm-dev at lists.llvm.org>:

> This morning I did a build with Ninja, which mysteriously decided to
> rebuild the entire system (something about a deps stamp being corrupted).
> When it was done, I had a new llvm-tblgen.exe, but all the target .inc
> files were old. Hmm. So I touched one of the TableGen source files and did
> another build. Again, a new llvm-tblgen.exe but no new .inc files. I do,
> however, have a new .inc.d file corresponding to each .inc file.
>
> I notice that those .inc.d files do not list llvm-tblgen.exe as a
> dependency. Is that why the .inc files aren't rebuilt? If so, what is the
> trick?
>
> ----------------------------------------------------------------
> Windfall               Paul C. Anagnostopoulos
>       ----------------------------------------------------------
>    Software            978 369-0839
>                              www.windfall.com
> ----------------------------------------------------------------
> My life has been filled with calamities,
> some of which actually happened.
> ---Mark Twain
>
> Guga 'mzimba, sala 'nhliziyo
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200811/4fdbf43a/attachment.html>


More information about the llvm-dev mailing list