Skip to content

Instantly share code, notes, and snippets.

@diasbruno
Last active May 10, 2017 22:35
Show Gist options
  • Save diasbruno/f8882d8493edbc5f9cb800d0b9f90d54 to your computer and use it in GitHub Desktop.
Save diasbruno/f8882d8493edbc5f9cb800d0b9f90d54 to your computer and use it in GitHub Desktop.
compile irony server on mac os x.
# first brew install llvm --with-clang
IRONY_PATH=`ls -1 ~/.emacs.d/elpa/ | grep ^irony | head -n 1`
LLVM_CONFIG=`which llvm-config`
if [ -z $LLVM_CONFIG ]; then
echo "llvm-config was not found. trying to find it at /usr/local..."
LLVM_CONFIG=`find /usr/local -type f -name llvm-config | head -n 1`
fi
LIBCLANG_LIBRARY=`$LLVM_CONFIG --libdir`/libclang.dylib
LIBCLANG_INCLUDE=`$LLVM_CONFIG --includedir`
cmake -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
-DLIBCLANG_LIBRARY=$LIBCLANG_LIBRARY \
-DLIBCLANG_INCLUDE_DIR=$LIBCLANG_INCLUDE \
-DCMAKE_INSTALL_PREFIX\=~/.emacs.d/irony/ ~/.emacs.d/elpa/$IRONY_PATH/server &&\
cmake --build . --use-stderr --config Release --target install
@diasbruno
Copy link
Author

llvm-config --includedir and --libdir if we have llvm-config available.
I don't know why, but it seems that brew don't link the llvm/{version}/bin.

@diasbruno
Copy link
Author

@pmetzger we can try to find on common places where llvm could be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment