With the landing of bug 973770 (and a few touch up landing this week) the Mozilla build system can now generate a fully working out-of-the-box no hassle eclipse workspace for C++ gecko development. This has been tested for Mac, Fennec and B2G. For Windows please use the Visual Studio project generator. If you find any bugs please file and link off bug 973770.
Didn’t we already support eclipse projects? Yes we did but the setup was quite tedious to setup and maintain. My approach automates some of these instructions and uses the information now available from within moz.build to generate the project. This also means we can remove the build scanning phase which tends to make Eclipse unresponsive.
To use this:
- Download the latest Eclipse CDT 8.3 package for your platform
- Build your tree
- Run |./mach build-backend -b CppEclipse|. For b2g cd into objdir-gecko and use |../gecko/mach build-backend -b CppEclipse|
- Start eclipse, use $OBJDIR/eclipse_workspace as the workspace
- File->Import->Existing Project with path $OBJDIR/eclipse_workspace/gecko
- Let the indexer run on the first start. This can take about 20 mins (long but worth it, see below). This will index your exact mozconfig setup (example -DDEBUG, b2g system libs).
Here are some benefits:
If you find yourself tweaking the project let me know so that I can integrate changes into the project generator instead where everyone can benefit.