[LLVMdev] [cfe-dev] RFC: Upcoming Build System Changes

Óscar Fuentes ofv at wanadoo.es
Fri Oct 28 00:54:45 PDT 2011


Chris Lattner <clattner at apple.com> writes:

>>> 1. It generates really slow build systems.
>> 
>> In my Linux box, last time I checked (long time ago) the cmake build was
>> a bit faster than the Makefiles. But this is a tricky terrain, because
>> they are not identical, not on the features supported (and some have an
>> impact on build-time) nor even on the options passed to the compiler.
>
> The makefiles are known to be really slow, among other problems being
> based on recursive make.  One goal of this is to get a non-recursive
> makefile generated.  We've prototyped this in the past and found it to
> be substantially faster than the recursive makefile.

A good measure of how fast a set of Makefile are is to run the build
with all targets up-to-date. Both builds takes a few seconds (3 or so)
on my Linux quad core box. Whatever improvement can be achieved on this
seems pretty insignifant.

Furthermore, recursive make is necessary for automatic generation of
header dependencies, among other things. The makefiles generated by
cmake are "partially" recursive for that reason:

http://www.cmake.org/Wiki/CMake_FAQ#Why_does_CMake_generate_recursive_Makefiles.3F

>>> 2. The build system generated by cmake is absolute garbage, at least
>>> for Xcode.  The build times of it are really bad, and having to work
>>> with it in the IDE is even more terrible.
>> 
>> AFAIK there is a Xcode project file on the LLVM source tree.
>
> Nope, there was once but it was removed a long time ago though.
>
>> Are the
>> LLVM makefiles used by the Xcode project?
>
> No, it is generated by Cmake.

So, the cmake-generated Xcode file was considered good enough or... ?

[snip]

Anyways, if you wish to avoid duplicating info on both Makefile and
CMakeLists.txt there is a simple solution: read and parse the Makefile
from the corresponding CMakeLists.txt. For instance, if you put the
library dependencies on the Makefile like this:

LLVMLIBDEPS := foo zoo bar

obtaining that info from the CMakeLists.txt and generating the cmake
library dependencies is very simple, nor even you have to put anything
new on all those CMakeLists.txt, just modify one of the macros that are
(indirectly) called from each CMakeLists.txt.



More information about the llvm-dev mailing list