Skip to content

Support VS 2017 lib.exe #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,18 @@ function combine::static() {
# Combine all objects into one static library
case $platform in
win)
# TODO: Support VS 2017
"$VS140COMNTOOLS../../VC/bin/lib" /OUT:$libname.lib @$libname.list
# Support VS 2017, https://devblogs.microsoft.com/cppblog/finding-the-visual-c-compiler-tools-in-visual-studio-2017/
vs2017_config_file="C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt"
if [ -e "$vs2017_config_file" ]; then
vs2017_version=`cat "$vs2017_config_file"`
vslib="C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/$vs2017_version/bin/Host$TARGET_CPU/$TARGET_CPU/lib"
elif [ ! -z "$VS140COMNTOOLS" ]; then
vslib="$VS140COMNTOOLS../../VC/bin/lib"
else
echo "Building under Microsoft Windows requires Microsoft Visual Studio 2015 Update 3"
exit 1
fi
"$vslib" /OUT:$libname.lib @$libname.list
;;
*)
# Combine *.a static libraries
Expand Down