[LLVMdev] State of CMake build system.

Óscar Fuentes ofv at wanadoo.es
Sat Sep 20 14:22:14 PDT 2008


IMHO, the CMake-based build system is almost complete enough to replace
current MSVC++ project files (modulo some community review and
bug-fixing). Is this enough for adding it to the LLVM repo?

>From the point of view of a MSVC++ user, the new build system is trivial
to maintain: you can add a new library or tool executable in less time
that it takes to open the project file on MSVC++, it covers VC++ 2003,
2005 and 2008, generating project files or NMake makefiles on demand and
it just requires a text editor for maintenance. It is on my TODO list to
add a mode that doesn't require an explicit list of source files, just
as LLVM make-based build system does now. IMHO it is a clear improvement
over what MSVC++ users have now, with the requirement of CMake as the
only drawback. However, CMake is trivial to install on Windows.

It works for MinGW and Linux too, but it far from complete. Only
supports the X86 target (although adding targets is not hard) and lacks
lots of bells and whistles that ./configure && make have now. More
specifically, it lacks all options configure has. I'm pretty confident
that, with not too much work, the CMake build can catch up with
./configure && make and improve over it. Mostly on the maintenance
area. The amount of explicit "bussiness logic" CMake demands is orders
of magnitude smaller than ./configure && make. CMake has its rough
edges, though, and there are things that I don't like, but it saves lots
of work.

Finally, please note that the CMake build system is absolutely
unobtrusive wrt current build systems, either the make-based or the
MSVC++ project files, and I'm not advocating the deprecation of neither
of them.

Notes:

* MSVC++ users: there is no LLVMX86.o. Link against LLVMX86.lib and add
  /INCLUDE:_X86TargetMachineModule to your executable's link option.

* Right now it ignores most of the examples (only builds Fibonacci). As
  an exercise, you can add the CMakeLists.txt file to each example
  directory and make the needed modifications to examples/CMakeLists.txt.

* Has no make install nor test.

* It is more than likely that there are some missing dependencies and
  that parallel builds are not right (please check if you have time).

* Only out-of-source builds are tested.

* It seems that MSVC++ 2003 and 2008 builds fails due to C++
  issues. Patches highly welcomed.

* For MSVC++, only NMake builds are tested. Please test IDE builds.

* On non-MSVC++ targets, make VERBOSE=1 is very useful. Please attach
  the output of this command when reporting issues.

* I'm sure I'm missing some notes.

-- 
Oscar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake.patch
Type: text/x-patch
Size: 73604 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080920/c6f9a716/attachment.bin>


More information about the llvm-dev mailing list