omnisharp build added to install script

This commit is contained in:
Chiel92 2013-07-16 17:17:57 +02:00
parent 485457af5d
commit 8066bdc29b

View File

@ -102,25 +102,29 @@ function linux_cmake_install {
} }
function usage { function usage {
echo "Usage: $0 [--clang-completer]" echo "Usage: $0 [--clang-completer] [--cs-completer]"
exit 0 exit 0
} }
if [[ $# -gt 1 ]]; then if [[ $# -gt 2 ]]; then
usage usage
fi fi
case "$1" in cmake_args=''
--clang-completer) omnisharp_completer=false
cmake_args='-DUSE_CLANG_COMPLETER=ON' for flag in $@; do
;; case "$flag" in
'') --clang-completer)
cmake_args='' cmake_args='-DUSE_CLANG_COMPLETER=ON'
;; ;;
*) --omnisharp-completer)
usage omnisharp_completer=true
;; ;;
esac *)
usage
;;
esac
done
if ! command_exists cmake; then if ! command_exists cmake; then
echo "CMake is required to build YouCompleteMe." echo "CMake is required to build YouCompleteMe."
@ -133,3 +137,20 @@ else
testrun $cmake_args $EXTRA_CMAKE_ARGS testrun $cmake_args $EXTRA_CMAKE_ARGS
fi fi
if $omnisharp_completer; then
buildcommand="msbuild"
if ! command_exists msbuild; then
buildcommand="xbuild"
if ! command_exists xbuild; then
echo "msbuild or xbuild is required to build Omnisharp"
exit 1
fi
fi
ycm_dir=`pwd`
build_dir=$ycm_dir"/python/ycm/completers/cs/OmniSharpServer"
cd $build_dir
$buildcommand
cd $ycm_dir
fi