building AOSP creating a compilation database

784 views
Skip to first unread message

Valerio

unread,
Oct 9, 2017, 9:54:04 AM10/9/17
to ninja-build
Hi *,

long story short: i want to create compilation database entry when AOSP is being compiled.

I read here [1] that ninja has a specific option to generate such db ( -t compdb [RULES...]), so I added NINJA_ARGS="-t compdb cxx" to the command used to build an individual AOSP component (actual command is mm). 
From my understanding, ninja should print out on stdout that JSON formatted db entry, shouldn't it? The compilation finished successfully but nothing was printed out, though. What am i doing wrong?

thanks,
ciao


Nico Weber

unread,
Oct 9, 2017, 9:56:25 AM10/9/17
to Valerio, ninja-build
Hi Valerio,

if AOSP's ninja generator produces rules called "cxx" for its C++ compilations, then what you did should have worked. Maybe AOSP's ninja generator uses a different name for its rules? Maybe someone from AOSP is lurking on this list, but if not you could ask on an AOSP list.

Nico

--
You received this message because you are subscribed to the Google Groups "ninja-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Valerio

unread,
Oct 9, 2017, 10:53:46 AM10/9/17
to ninja-build
Thank you Nico!
I already wrote to AOSP list but I have got no answer yet. 
I will try to figure out where AOSP's ninja generator is located and which names are used for its rules.
To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build...@googlegroups.com.

Nico Weber

unread,
Oct 9, 2017, 10:57:58 AM10/9/17
to Valerio, ninja-build
I believe the generator they use is a mix of https://android.googlesource.com/platform/build/kati/ and https://android.googlesource.com/platform/build/blueprint/ -- I might be wrong though, and I don't know how these generators call their rules.

To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build+unsubscribe@googlegroups.com.

Valerio

unread,
Oct 9, 2017, 11:14:34 AM10/9/17
to ninja-build
Yes you are right, i am quite new to ninja build system that's why i don't know very well how it works. 
Kati is used to convert a Makefile to a ninja file and blueprint produces a ninja manifest (i guess the manifest specifies which commands to run and their dep, but I might be wrong).

Dumb questions. 
ninja's rules are defined in .ninja files ( build.ninja is the default name ), aren't they? if it is the case, looking into all files named .ninja in AOSP I should find the one defining the rule I am interested to. am i right?

Nico Weber

unread,
Oct 9, 2017, 11:16:56 AM10/9/17
to Valerio, ninja-build
Yes, that's correct.

To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build+unsubscribe@googlegroups.com.

Valerio

unread,
Oct 9, 2017, 12:18:16 PM10/9/17
to ninja-build
Thank you, now the overall picture has a better shape.
I have found *.ninja files in AOSP, but now I need to figure out what rule i am interested in, because all rules' name are quite casual, like rule 1, rule 2, etc...
just to check if I am on the right way: to achieve my goal i am supposed to find the actual "rule" used to compile cpp files, right? do you have any hint about how could it look like?

grazie mille
Reply all
Reply to author
Forward
0 new messages