[cfe-dev] Building clang outside of LLVM (with CMake)

Douglas Gregor dgregor at apple.com
Wed Feb 2 16:01:43 PST 2011


On Feb 2, 2011, at 2:29 PM, Óscar Fuentes wrote:

> Douglas Gregor <dgregor at apple.com> writes:
> 
>> We'd like to be able to consider LLVM as a stable library that Clang
>> depends on. This would allow us to build against an installed LLVM
>> (rather than embedding our own full copy of LLVM in Clang), test Clang
>> and LLVM more independently,
> [snip]
> 
> There are some configuration options (C_INCLUDE_DIRS,
> CLANG_RESOURCE_DIR) which are stored on LLVM's config.h file.
> 
> The Right Thing is to create a config.h file for Clang, which is a task
> a bit more obtrusive than I used to. It would consist on passing
> -DHAVE_CLANG_CONFIG_H on the command line and adding
> 
> #ifdef HAVE_CLANG_CONFIG_H
> # include "clang/Config/config.h"
> #endif
> 
> where necessary. This allows the autoconf build to remain unaffected.


This sounds like the right approach.

	- Doug



More information about the cfe-dev mailing list