加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
windows_toolchain_download.sh 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
程序鸭 提交于 2023-04-25 19:55 . [*] update
#!/bin/bash
# Copyright (c) 2023 DoubleByte.
# This is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
source build/path.sh
source build/util.sh
readonly LLVM_MINGW_MAC_TAR="$LLVM_MINGW_MAC.tar"
readonly LLVM_MINGW_LINUX_TAR="$LLVM_MINGW_LINUX.tar"
readonly CHENGXUYA="https://chengxuya.top/share"
mac_download() {
cd $BUILD_BIN_PATH
if [ ! -f $LLVM_MINGW_MAC_TAR.xz ]; then
wget -c $CHENGXUYA/$LLVM_MINGW_MAC_TAR.xz
fi
xz -d $LLVM_MINGW_MAC_TAR.xz
tar -xvf $LLVM_MINGW_MAC_TAR
rm $LLVM_MINGW_MAC_TAR
}
linux_download() {
cd $BUILD_BIN_PATH
if [ ! -f $LLVM_MINGW_LINUX_TAR.xz ]; then
wget -c $CHENGXUYA/$LLVM_MINGW_LINUX_TAR.xz
fi
xz -d $LLVM_MINGW_LINUX_TAR.xz
tar -xvf $LLVM_MINGW_LINUX_TAR
rm $LLVM_MINGW_LINUX_TAR
}
platform
case $HOST_PLATFORM in
"Linux")
if [ -x $LLVM_MINGW_LINUX_BIN_PATH/clang-16 ]; then
echo -e "\033[1;32mwidnows_toolchain_download is ok\033[0m"
exit 0
fi
linux_download
;;
"Darwin")
if [ -x $LLVM_MINGW_MAC_BIN_PATH/clang-16 ]; then
echo -e "\033[1;32mwidnows_toolchain_download is ok\033[0m"
exit 0
fi
mac_download
;;
esac
echo -e "\033[1;32mwidnows_toolchain_download successful\033[0m"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化