Add VS 2022 support

This commit is contained in:
Michael Campagnaro 2021-11-22 12:51:49 -05:00
parent 4cb20a50fa
commit 25bc144d18

View File

@ -18,27 +18,46 @@ get_msvc_bin_path() {
_path=""
_x64_toolset=0
if [[ $VisualStudioVersion == "14.0" ]]; then
##########################################
# Visual Studio 2015
##########################################
_path="$VCINSTALLDIR"
if [[ $(env | grep "LIB=" | grep "x64") != "" ]]; then
printf "${BOLD}${YELLOW}[VS2015 X64]${NORMAL}\n"
##########################################
# Visual Studio 2022
##########################################
if [[ $VisualStudioVersion == "17.0" ]]; then
_path="$VCToolsInstallDir"
if [[ $VSCMD_ARG_HOST_ARCH == "x64" ]]; then
printf "${BOLD}${YELLOW}[VS2022 X64]${NORMAL}\n"
_x64_toolset=1
_path+="bin/amd64"
elif [[ $(env | grep "LIB=" | grep "x86") != "" ]]; then
printf "${BOLD}${YELLOW}[VS2015 X86]${NORMAL}\n"
_path+="bin/"
_path+="bin/Hostx64/x64"
elif [[ $VSCMD_ARG_HOST_ARCH == "x86" ]]; then
printf "${BOLD}${YELLOW}[VS2022 X86]${NORMAL}\n"
_path+="bin/Hostx86/x86"
else
error "Unable to determine if you're using an x86 or x64 MSVC toolset\n"
exit 1
fi
##########################################
# Visual Studio 2019
##########################################
elif [[ $VisualStudioVersion == "16.0" ]]; then
_path="$VCToolsInstallDir"
if [[ $VSCMD_ARG_HOST_ARCH == "x64" ]]; then
printf "${BOLD}${YELLOW}[VS2019 X64]${NORMAL}\n"
_x64_toolset=1
_path+="bin/Hostx64/x64"
elif [[ $VSCMD_ARG_HOST_ARCH == "x86" ]]; then
printf "${BOLD}${YELLOW}[VS2019 X86]${NORMAL}\n"
_path+="bin/Hostx86/x86"
else
error "Unable to determine if you're using an x86 or x64 MSVC toolset\n"
exit 1
fi
##########################################
# Visual Studio 2017
##########################################
elif [[ $VisualStudioVersion == "15.0" ]]; then
##########################################
# Visual Studio 2017
##########################################
_path="$VCToolsInstallDir"
if [[ $VSCMD_ARG_HOST_ARCH == "x64" ]]; then
@ -52,19 +71,19 @@ get_msvc_bin_path() {
error "Unable to determine if you're using an x86 or x64 MSVC toolset\n"
exit 1
fi
elif [[ $VisualStudioVersion == "16.0" ]]; then
##########################################
# Visual Studio 2019
##########################################
_path="$VCToolsInstallDir"
##########################################
# Visual Studio 2015
##########################################
elif [[ $VisualStudioVersion == "14.0" ]]; then
_path="$VCINSTALLDIR"
if [[ $VSCMD_ARG_HOST_ARCH == "x64" ]]; then
printf "${BOLD}${YELLOW}[VS2019 X64]${NORMAL}\n"
if [[ $(env | grep "LIB=" | grep "x64") != "" ]]; then
printf "${BOLD}${YELLOW}[VS2015 X64]${NORMAL}\n"
_x64_toolset=1
_path+="bin/Hostx64/x64"
elif [[ $VSCMD_ARG_HOST_ARCH == "x86" ]]; then
printf "${BOLD}${YELLOW}[VS2019 X86]${NORMAL}\n"
_path+="bin/Hostx86/x86"
_path+="bin/amd64"
elif [[ $(env | grep "LIB=" | grep "x86") != "" ]]; then
printf "${BOLD}${YELLOW}[VS2015 X86]${NORMAL}\n"
_path+="bin/"
else
error "Unable to determine if you're using an x86 or x64 MSVC toolset\n"
exit 1