ported from UXP: moz.configure: Windows SDK from version 10.0.15063.0 onwards the bin path contains the version number.

This commit is contained in:
2022-12-30 10:09:00 +08:00
parent ad339eed7a
commit 7637d89171
+10 -10
View File
@@ -1,5 +1,4 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -335,11 +334,8 @@ def lib_path(target, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
atlmfc_dir = os.path.join(vc_path, 'atlmfc', 'lib', *vc_target)
if not os.path.isdir(atlmfc_dir):
# For Visual Studio 2017
atlmfc_dir = os.path.join(vc_path, 'atlmfc', 'lib', sdk_target)
if not os.path.isdir(atlmfc_dir):
die('Cannot find the ATL/MFC libraries in the Visual C++ directory '
'(%s). Please install them.' % vc_path)
die('Cannot find the ATL/MFC libraries in the Visual C++ directory (%s). '
'Please install them.' % vc_path)
libs = []
@@ -364,10 +360,10 @@ set_config('LIB', lib_path)
option(env='MT', nargs=1, help='Path to the Microsoft Manifest Tool')
@depends_win(valid_windows_sdk_dir)
@depends_win(valid_windows_sdk_dir, valid_ucrt_sdk_dir)
@imports(_from='os', _import='environ')
@imports('platform')
def sdk_bin_path(valid_windows_sdk_dir):
def sdk_bin_path(valid_windows_sdk_dir, valid_ucrt_sdk_dir):
if not valid_windows_sdk_dir:
return
@@ -376,13 +372,17 @@ def sdk_bin_path(valid_windows_sdk_dir):
'AMD64': 'x64',
}.get(platform.machine())
# From version 10.0.15063.0 onwards the bin path contains the version number.
versioned_bin = ('bin' if valid_ucrt_sdk_dir.version < '10.0.15063.0'
else os.path.join('bin', str(valid_ucrt_sdk_dir.version)))
result = [
environ['PATH'],
os.path.join(valid_windows_sdk_dir.path, 'bin', vc_host)
os.path.join(valid_windows_sdk_dir.path, versioned_bin, vc_host)
]
if vc_host == 'x64':
result.append(
os.path.join(valid_windows_sdk_dir.path, 'bin', 'x86'))
os.path.join(valid_windows_sdk_dir.path, versioned_bin, 'x86'))
return result