[LLVMdev] Using LLVM JIT inside a Cocoa application

Jean-Daniel Dupas devlists at shadowlab.org
Fri Jun 5 04:31:57 PDT 2009


I'm not an LLVM expert, but I think you can build a Cocoa/LLVM project  
by using the LLVM's libraries and headers the same way you did with  
any other third party library.

In fact, that's what the clang Xcode project does. It does not use any  

In short:
	- Add the llvm/include folder in you header search path (in the  
project's build settings).

To add libraries, an option may be to drop the *.a you need in your  
Xcode project, and Xcode is smart enough to adjust the library search  
path as needed.

and other option (the one chosen by clang) may be to change build  
	- Add the llvm/<output>/lib/ folder in you library search path  
(replace <output> by the name of the llvm build dir. You can choose a  
value based on your build configuration to use different libraries  
variant in Debug and Release).
	- Add linker flags to tell the linker which LLVM libraries you want  
to use.

Le 5 juin 09 à 11:59, Camille Troillard a écrit :

> Hello,
> I am trying to compile a project I am writing with Xcode that will use
> LLVM libraries to generate code executed with the JIT.
> I would be curious to learn how you deal with LLVM header files,
> libraries, makefiles and Cocoa application projects.
> My candid understanding is that LLVM projects need to be built with
> LLVM makefiles (hence the previous message I sent about LLVM
> Projects).  I am not totally reluctant to the idea of building a
> library outside of Xcode and then linking it to my Cocoa project, but
> I find it rather annoying to maintain two project structures.  With
> some work it would be possible to automate all of this build project
> inside Xcode, but I was hoping a more straightforward solution.
> Any ideas?
> Best Regards,
> Camille
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list