I've started to work on a project in my spare time to switch us to use unified builds for C/C++ compilation. The way that unified builds work is by using the UNIFIED_SOURCES instead of the SOURCES variable in moz.build files. With that, the build system creates files such as:
// Unified_cpp_path_0.cpp #include "Source1.cpp" #include "Source2.cpp" // ... And compiles them instead of the individual source files. The advantage of this is that it speeds up the compilation (I've measured between 6-15x speed improvement depending on the code in question locally.) But there are also trade-offs with this approach. One trade-off is that the source code might require changes before it can be compiled in this way, due to things like name clashes, etc. The other one is that if you change one .cpp file which is built in unified mode, we would spend more time compiling it because we'll be compiling the unified .cpp file which includes more than what you have changed. It's hard to come up with numbers for this trade-off, but assuming that the linking step takes way longer than the C++ compilation in the "touch one .cpp file" scenario, and also that changes to headers will potentially trigger multiple .cpp rebuilds in the same directory, I think doing unified builds in more parts of the tree is a reasonable choice. I'm going to continue working on this as time permits, if you're interested in helping out, or if you have questions, please get in touch. Cheers, -- Ehsan <http://ehsanakhgari.org/> _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform