So recently I have been trying to set up a Vim-based iOS workflow.
I found clang_complete, and have set the clang user options in my .vimrc like so
let g:clang_user_options='-fblocks -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300'
as described here: http://www.zenskg.net/wordpress/?p=199#comment-229
and added a few framework/header/lib paths. I’m not going to post the whole line because it is huge.
So I tested the compilation of one of the files in my project using clang from the command line (using the same options), and it compiles fine, but only if I use the -arch armv6/7 flag. If I don’t it tries to compile for i386 and complains of missing header files.
So far so good. Now I just use the exact same options I gave to clang, to clang_complete‘s user options in my .vimrc right?
Nope. When I do that and try to autocomplete a word in Vim, it says
unknown argument: '-arch'
in the QuickFix list of Vim. I kinda need this flag- how should I proceed?
Any ideas useful. I would love to get iOS code completion working under Vim.
clang_complete runs
clang -cc1, which causes the compiler front-end to run and not the driver. The compiler front-end doesn’t understand the-archoption.clang -cc1 --helpwill show you the possible options. You should probably specify-tripleor one of-target-*.If you’re not sure what to use, you can run clang manually as you did, but in verbose mode (
-v). This way it will print theclang -cc1command line, where you can find the appropriate arguments.