Skip to content

Commit

Permalink
fix clang problem on MacOS mojave
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaloc committed Mar 10, 2019
1 parent 80169dc commit 0781d67
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,33 @@ function compile_ycm_on_linux()
./install.py --clang-completer
}

# mac编译ycm插件
function compile_ycm_on_mac()
# macos编译ycm, 原始方法
function compile_ycm_on_mac_legacy()
{
cd ~/.vim/plugged/YouCompleteMe
./install.py --clang-completer --system-libclang
}

# macos编译ycm, Mojave上的方法
function compile_ycm_on_mac_mojave()
{
echo "Installing macOS_10.14 sdk headers..."
xcode-select --install
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
cd ~/.vim/plugged/YouCompleteMe
./install.py --clang-completer
}

# 在MacOS上编译ycm
function compile_ycm_on_mac()
{
mac_version=$(sw_vers | grep ProductVersion | cut -d '.' -f 2 -f 3)
fix_macos_version_list=(14.1 14.2 14.3)
echo "${fix_macos_version_list[@]}" | grep -wq "$mac_version" && \
compile_ycm_on_mac_mojave || \
compile_ycm_on_mac_legacy
}

# 打印logo
function print_logo()
{
Expand Down

0 comments on commit 0781d67

Please sign in to comment.