Rewrite ext setup scripts + module-cc irony path
This commit is contained in:
parent
a1b0db0b07
commit
483bdb79ee
4 changed files with 60 additions and 25 deletions
|
@ -1,27 +1,48 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cd ~/.emacs.d/ext
|
||||
source ./VARS
|
||||
|
||||
LLVMV="3.8.0"
|
||||
LLVM="clang+llvm-${LLVMV}-x86_64-apple-darwin"
|
||||
source VARS
|
||||
|
||||
#
|
||||
echo "Setting up C/C++ (irony-mode)"
|
||||
|
||||
if is-mac; then
|
||||
brew install cmake
|
||||
brew install llvm --with-clang
|
||||
fi
|
||||
case "$OSTYPE" in
|
||||
darwin*)
|
||||
brew install cmake
|
||||
brew install llvm --with-clang
|
||||
;;
|
||||
linux*)
|
||||
if is-arch; then
|
||||
sudo pacman --noconfirm -S cmake clang
|
||||
elif is-deb; then
|
||||
echo "Not implemented"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Build irony-server
|
||||
git-repo "https://github.com/Sarcasm/irony-mode" "irony-mode"
|
||||
|
||||
# Reset build directory
|
||||
cd irony-mode/server
|
||||
[ -d build ] && rm -rf build
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_INSTALL_RPATH_USE_LINK_PATH\=ON \
|
||||
-DCMAKE_INSTALL_PREFIX\=${CACHE_DIR}/irony/ ../ && \
|
||||
cmake --build . --use-stderr --config Release --target install
|
||||
install_name_tool -change @rpath/libclang.dylib \
|
||||
/usr/local/opt/llvm/lib/libclang.dylib \
|
||||
${CACHE_DIR}/irony/bin/irony-server
|
||||
|
||||
DEST="$(pwd)/irony-mode/server/build/irony/"
|
||||
|
||||
# Compile
|
||||
if is-mac
|
||||
then
|
||||
cmake -DCMAKE_INSTALL_RPATH_USE_LINK_PATH\=ON \
|
||||
-DCMAKE_INSTALL_PREFIX\="$DEST" ../
|
||||
else
|
||||
cmake -DCMAKE_INSTALL_PREFIX\="$DEST" ../
|
||||
fi
|
||||
cmake --build . --use-stderr --config Release --target install
|
||||
|
||||
if is-mac
|
||||
then
|
||||
install_name_tool -change @rpath/libclang.dylib \
|
||||
/usr/local/opt/llvm/lib/libclang.dylib \
|
||||
$DEST/bin/irony-server
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue