[cfe-dev] Building LLVM and clang with different options

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri May 29 10:21:07 PDT 2015

I'm trying to build LLVM with a build type of MinSizeRel and clang with a
build type of Debug. I've cloned llvm and clang (into llvm/tools/clang),
created a build directory parallel to llvm and from it, and invoked 'cmake
-G "Unix Makefiles" ../llvm'. I changed (in build/CMakeCache.txt)
CMAKE_BUILD_TYPE to MinSizeRel and ran make - both LLVM and clang are built
successfully. I now want to build clang in Debug mode, but don't see any
obvious way of doing this - changing the CMAKE_BUILD_TYPE to Debug causes
LLVM to be rebuilt in Debug mode, too. Is there an easy way to do this via
CMake, or is some other approach required?


Vinay Sajip

More information about the cfe-dev mailing list