Embed libclang in an iOS app
clang, llvm, makefile, static-libraries
Solution
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.
Problem
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.