Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Compiler features for dependency data generation #1

Closed
matheusmoreira opened this issue Mar 14, 2019 · 1 comment
Closed

Compiler features for dependency data generation #1

matheusmoreira opened this issue Mar 14, 2019 · 1 comment
Assignees
Labels
build Build system issues enhancement New feature or request question Further information is requested

Comments

@matheusmoreira
Copy link
Owner

What compilers feature dependency data generation? How best to use them?

@matheusmoreira matheusmoreira created this issue from a note in Automated file dependency tracking (TODO) Mar 14, 2019
@matheusmoreira matheusmoreira self-assigned this Mar 14, 2019
@matheusmoreira matheusmoreira added enhancement New feature or request question Further information is requested build Build system issues labels Mar 14, 2019
@matheusmoreira
Copy link
Owner Author

matheusmoreira commented Mar 14, 2019

Both gcc and clang support dependency data generation. Their options are apparently compatible. The parameters -M -MF $dependency -MT $target are appropriate: the library is likely to benefit from recompilation when linux headers are updated and since these compilers simplify the target's path it needs to be set explicitly in order to be compatible with the prefixed path method.

Since support for other compilers is a possibility, generating dependency data as a side effect of compilation might be problematic. Perhaps there is a way to avoid generating rules for dependency files in case an unsupported compiler is chosen. The alternative would be separate rules and recipes for these dependency files and it would require either gcc or clang even if they are not the selected compilers.

@matheusmoreira matheusmoreira moved this from TODO to In progress in Automated file dependency tracking Mar 14, 2019
matheusmoreira added a commit that referenced this issue Mar 21, 2019
This make function generates a set of options that instruct GCC to generate
dependency information from an input file, add extra targets to it and then
write the data to an output file.

This happens separately from the compilation step since support for
alternative compilers is desirable. This way, supported compilers can be
used to generate dependency information and other compilers can be used
to actually compile the code.
In any case, these options should also be compatible with clang.

References:

https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html
https://clang.llvm.org/docs/ClangCommandLineReference.html#dependency-file-generation
#1 (comment)
Automated file dependency tracking automation moved this from In progress to Completed Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Build system issues enhancement New feature or request question Further information is requested
Projects
No open projects
Development

No branches or pull requests

1 participant