Skip to content

Build system improvements pack - addressing comments to PR and some issues. #546

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

Merged
merged 7 commits into from
Nov 7, 2017
Prev Previous commit
Next Next commit
Fix for the #539 classic build fails when VS 2017 installed.
  • Loading branch information
dse committed Sep 22, 2017
commit f1229bd6bd4a4ba16f8c00d0aadd82e15bed84ca
14 changes: 14 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,20 @@ def _install_packages(self):

def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False):
"""Return full path to one of the Microsoft build tools"""

# trying to search path with help of vswhere when MSBuild 15.0 and higher installed.
if use_windows_sdk==False:
try:
basePathes = subprocess.check_output(
["tools\\vswhere\\vswhere.exe", "-latest",
"-version", "[15.0, 16.0)",
"-requires", "Microsoft.Component.MSBuild",
"-property", "InstallationPath"]).splitlines()
if len(basePathes):
return os.path.join(basePathes[0].decode(sys.stdout.encoding or "utf-8"), "MSBuild", "15.0", "Bin", "MSBuild.exe")
except:
pass # keep trying to search by old method.

# Search in PATH first
path = spawn.find_executable(tool)
if path:
Expand Down