[LLVMdev] LLVM development in Xcode

Óscar Fuentes ofv at wanadoo.es
Wed Apr 28 10:32:43 PDT 2010

"Relph, Richard" <Richard.Relph at amd.com> writes:

> In trying to set up a LLVM development environment, CMake seemed "too
> easy" - cmake <srctree>. No configuration options necessary
> whatsoever. But it worked, at least for Xcode on MacOS and for Visual
> Studio on Windows. Builds were successful. I have not tried running
> any of the output yet, though, since I don't yet have a front-end set
> up.

It is advisable to set CMAKE_BUILD_TYPE to either Release or
Debug. Other variants (including "undefined") are not tested nor are
taken too much attention on the code.

> Yet in discussion here, a lot of people are referring to configure
> options and the like.
> When or why should someone use configure instead of CMake or
> vice-versa?

CMake is your only option for working with Visual Studio and other
IDEs. Some people prefer CMake because that's what they use for other
projects, or because they just enjoy using it.

configure is used because it was there since the beginning and because
it is much more popular on the *nix field. It has some other minor
advantages, like not requiring to install extra stuff.

> Are both equally well maintained?

It depends. Out of the box, maybe the autoconf build has more features,
most of them rarely used and easily replicable on cmake. OTOH, some
features like building shared libraries are was recently added to the
autoconf build was on the cmake build since almost the
beginning. Sometimes a new key feature of LLVM is implemented on the
autoconf build and the cmake one is ignored by the author, nobody
dreaming of putting a requirement for only accepting the feature iff is
implemented on both systems. An instance of that was loadable modules,
IIRC. Other key features for subsets of LLVM users are still
unimplemented, as it is the case of the OCaml bindings. On this aspect,
the cmake build is like a stepchild who only counts for a few members
of the family.

The most clear advantages of the CMake build are its cross-platform
support, it's easy maintenance and its flexibility.

> What configure options does an optionless CMake-created build
> environment most closely match?

cmake -DCMAKE_BUILD_TYPE=Release should be a close match for configure
--enable-optimized. Same for Debug.

More information about the llvm-dev mailing list