我可以按照本教程在我的OSX上构建llvm和clang:
http://clang.llvm.org/docs/LibASTMatchersTutorial.html
为此,我使用cmake和忍者。
然后我可以在下面找到我的libclang.3.6.dylib
<path_to_llvm>/build/lib/libclang.3.6.dylib
。问题是库不是胖。我的意思是它仅为 x86_64 构建。我可以用以下方式验证:
lipo -info libclang.3.6.dylib
这产生:
Non-fat file: lib/libclang.3.6.dylib is architecture: x86_64
但我还需要 i386
我有几个问题:
答案 0 :(得分:0)
Additional argument to cmake "-DCMAKE_OSX_ARCHITECTURES=x86_64;i386" did the trick. I guess this works only for OSX.
Now if I run lipo, I will receive desired output.
lipo -info lib/libclang.3.6.dylib
Architectures in the fat file: lib/libclang.3.6.dylib are: x86_64 i386
But I still have to recompile whole llvm/clang project (takes a few hours)