[cfe-dev] Build clang plugin with Clang Binaries
ofv at wanadoo.es
Mon Mar 7 13:26:38 CST 2011
Hao Jiang <hjian001 at fiu.edu> writes:
> Is there a way to build clang plugin with clang binaries? Or build plugin
> with clang source code and LLVM binaries? I want to do this cause building
> time for LLVM is unbearable long, so I want to build the clang plugin
> without building LLVM. Any suggestions is appreciated.
> Hao Jiang
With CMake, Clang can be built as an independent project using LLVM as
an external set of libraries. First, build LLVM with CMake, install it
(optional) and then checkout Clang sources outside of the LLVM source
tree. Create a build directory for Clang and invoke CMake from there as
(the above is just one command to be entered as a single line). That
will create the required makefiles for building Clang.
You don't need "-DCLANG_PATH_TO_LLVM_SOURCE=/where/llvm/sources/are" if
CLANG_PATH_TO_LLVM_BUILD points to a directory where LLVM was
installed. Be sure that CMAKE_BUILD_TYPE is the same for LLVM and
Clang. It can be Debug or Release.
More information about the LLVM CMake build system:
More information about the cfe-dev