So I just installed Xcode on my Mac and now I would like to install LLVM as well in order to play around a bit with LLVM itself. Currently the compiler can (obviously) not find the required header files. So what is the best way to install LLVM if you already have clang, packed with Xcode, on your system?
Thanks in advance.
If you do not need to read LLVM implementation source code(such as in
lib
/tools
directories) and might only play withlibclang
, perhaps usinghomebrew
is enough for you.Next you need to set
PATH
,CPLUS_INCLUDE_PATH
andLD_LIBRARY_PATH
. For me,You might configure the above information in your LLVM derived project with XCode.
However if you are also interested in
Compiler-RT
,Clang-Tools-Extra
(see LLVM Download Page) you probably have to make LLVM as your XCode project (download from that page or via SVN as said in Getting Started with the LLVM System). After putting the sub-projects in proper directories, you can use XCode generator from CMake, the typical usage is:Use XCode to open the project file XXX.xcodeproj and it should build the project.