Add a hook to supply a custom CompilationDatabase. To add a custom CompilationDatabase, make it implement findCompilationDatabaseForDirectory in CustomCompilationDatabase.h and set USE_COSTUM_COMPILATION_DATABASE.
Details
Diff Detail
Event Timeline
Do we want to add a FIXME comment about where we want this to go in the future, so others can jump in and run ahead easily? The CustomCompilationDatabase.h header comment would seem like the perfect place.
For example:
The mechanism can be used by IDEs or non-public code bases to integrate with their build system. Currently we support statically linking in an implementation of \c findCompilationDatabaseForDirectory and enabling it with -DUSE_CUSTOM_COMPILATION_DATABASE when compiling the Tooling library.
FIXME: The strategy forward is to provide a plugin system that can load custom compilation databases and make enabling that a build option.
lib/Tooling/CompilationDatabase.cpp | ||
---|---|---|
21 | I think that's either spelled COSTUME or CUSTOM. |
The code looks fine, but see my comment below...
lib/Tooling/CustomCompilationDatabase.h | ||
---|---|---|
32 | What are the semantics of Directory? Which directory will be passed in? That of the file? The project? The working directory? How will we even identify the project directory if we don't have the compilation database file? I think there are some unanswered interface and design questions here. |
Typo..
lib/Tooling/CustomCompilationDatabase.h | ||
---|---|---|
32 | I suggest this comment as interface definition. What do you think? |
I think that's either spelled COSTUME or CUSTOM.