create clang compilation database out of Android building process

23 views
Skip to first unread message

Valerio

unread,
Oct 9, 2017, 10:24:38 AM10/9/17
to Android Building
Hi *,
long story short: i would like to produce compilation database while AOSP is being compiled. I need those for parsing the AOSP code via LibTooling.

I'am using the android-master branch which clang version is 5.0. I am aware of the clang option "-MJ" [1] (which requires clang >= 5.0) so I modified the file Android.bp including that CLANG flag, for instance i took the libmedia component. The thing is that -MJ generates a compilation database entry per input, so the file was specified as database output is overwritten for each compiled file.

How can I get a compilation database entry for each file being compiled during AOSP building process? Can I modify some AOSP building script to achieve something like "-MJ$sourcefile" where $sourcefile takes the value of the source file being compiled?

In [1] I see that also the ninja building system supports an option to produce compiling database, in your opinion which approach is the best, clang or ninja?

any idea?
thank you so much!!

ciao,



Reply all
Reply to author
Forward
0 new messages