brew install llvm --with-clang
(use-package irony :ensure t
:config
(add-hook 'objc-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
(use-package company-irony :ensure t
:config
(add-hook 'objc-mode-hook (lambda ()
(setq-local company-backends '((company-irony)))))
(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands))
Run:
M-x irony-install-server
NOTE: Needs libclang: Install with "brew install llvm –with-clang" By default, irony-install-server did not find libclang on Mac OS. irony-install-server invokes cmake for you. Work around by adding:
-DCMAKE_PREFIX_PATH=/Users/your-user-name/homebrew/opt/llvm
For example:
cmake -DCMAKE_PREFIX_PATH=/Users/your-user-name/homebrew/opt/llvm -DCMAKE_INSTALL_PREFIX\=/Users/your-user-name/.emacs.d/irony/ /Users/your-user-name/.emacs.d/elpa/irony-20160106.1223/server && cmake --build . --use-stderr --config Release --target install
brew install xctool
xctool -sdk iphonesimulator -arch x86_64 -scheme SomeScheme -reporter pretty -reporter json-compilation-database:compile_commands.json clean build
M-x irony-cdb-json-add-compile-commands-path