Skip to content

Commit

Permalink
Merge pull request ycm-core#436 from junkblocker/patch-1
Browse files Browse the repository at this point in the history
Allow easier system libclang use
  • Loading branch information
Valloric committed Jul 15, 2013
2 parents 60db012 + c89ef89 commit 2ed9ae7
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,26 +102,32 @@ function linux_cmake_install {
}

function usage {
echo "Usage: $0 [--clang-completer]"
echo "Usage: $0 [--clang-completer [--system-libclang]]"
exit 0
}

if [[ $# -gt 1 ]]; then
cmake_args=''
while [ -n "$1" ]; do
case "$1" in
--clang-completer)
cmake_args="$cmake_args -DUSE_CLANG_COMPLETER=ON"
shift
;;
--system-libclang)
cmake_args="$cmake_args -DUSE_SYSTEM_LIBCLANG=ON"
shift
;;
*)
usage
;;
esac
done

if [[ $cmake_args == *-DUSE_SYSTEM_LIBCLANG=ON* ]] && \
[[ $cmake_args != *-DUSE_CLANG_COMPLETER=ON* ]]; then
usage
fi

case "$1" in
--clang-completer)
cmake_args='-DUSE_CLANG_COMPLETER=ON'
;;
'')
cmake_args=''
;;
*)
usage
;;
esac

if ! command_exists cmake; then
echo "CMake is required to build YouCompleteMe."
cmake_install
Expand Down

0 comments on commit 2ed9ae7

Please sign in to comment.