Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed libclang in an iOS app

I need to use libclang in an iOS app (for diagnostics and syntax highlighting) but I can't seem to figure out how to build it as is, let alone for iOS. Using CMake I generated an Xcode project for LLVM, but Xcode ran out of memory and disk space for swap (a combined 25GB!) and crashed while opening the project. I need to get a static library out of it, and then I can manually import the headers, which shouldn't be a problem. What configure/make/cmake command [combinations] would I need to run?

Note: I only need the functions in the Index.h file if it makes any difference.

Thanks in advance.

like image 818
Josh The Geek Avatar asked Jul 23 '12 20:07

Josh The Geek


1 Answers

I have created a series of articles for building clang.

  • llvm / Clang hacking - Part 1
  • llvm / Clang hacking - Part 2
  • llvm / Clang hacking - Part 3

You'll have some additional challenges building for iOS, but this would be a starting point.

like image 61
Stuart Carnie Avatar answered Oct 21 '22 04:10

Stuart Carnie