Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SCons/scons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Brill <48932340+jcbrill@users.noreply.github.com>2022-07-18 10:17:42 +0300
committerJoseph Brill <48932340+jcbrill@users.noreply.github.com>2022-07-18 10:17:42 +0300
commit32bfd79a27f2c28f8b8feea396e1636c55fa0f28 (patch)
tree009731e798d2942191580cdb2289f247c6e4cf69
parentd7664eb17d902d3540cfcdda226bd55e9c86cdf0 (diff)
Add special case for msvc 14.0 and store/uwp specified via script args and sdk specified via construction variable or forced. Revise forced default toolset handling (may have passed default toolset as an argument inadvertently). Add more tests.
-rw-r--r--SCons/Tool/MSCommon/MSVC/ScriptArguments.py44
-rw-r--r--test/MSVC/MSVC_SDK_VERSION.py4
-rw-r--r--test/MSVC/MSVC_SPECTRE_LIBS.py6
-rw-r--r--test/MSVC/MSVC_TOOLSET_VERSION.py4
-rw-r--r--test/MSVC/MSVC_UWP_APP.py310
5 files changed, 165 insertions, 203 deletions
diff --git a/SCons/Tool/MSCommon/MSVC/ScriptArguments.py b/SCons/Tool/MSCommon/MSVC/ScriptArguments.py
index 390e93ade..b4191de0a 100644
--- a/SCons/Tool/MSCommon/MSVC/ScriptArguments.py
+++ b/SCons/Tool/MSCommon/MSVC/ScriptArguments.py
@@ -157,7 +157,6 @@ if CONFIG_CACHE_FORCE_DEFAULT_ARGUMENTS:
@enum.unique
class SortOrder(enum.IntEnum):
- ARCH = 0 # arch
UWP = 1 # MSVC_UWP_APP
SDK = 2 # MSVC_SDK_VERSION
TOOLSET = 3 # MSVC_TOOLSET_VERSION
@@ -232,7 +231,7 @@ def _user_script_argument_uwp(env, uwp, user_argstr):
matches = [m for m in re_vcvars_uwp.finditer(user_argstr)]
if not matches:
- return None
+ return False
if len(matches) > 1:
debug('multiple uwp declarations: MSVC_SCRIPT_ARGS=%s', repr(user_argstr))
@@ -240,7 +239,7 @@ def _user_script_argument_uwp(env, uwp, user_argstr):
raise MSVCArgumentError(err_msg)
if not uwp:
- return None
+ return True
env_argstr = env.get('MSVC_UWP_APP','')
debug('multiple uwp declarations: MSVC_UWP_APP=%s, MSVC_SCRIPT_ARGS=%s', repr(env_argstr), repr(user_argstr))
@@ -686,7 +685,7 @@ def _msvc_script_argument_toolset(env, msvc, vc_dir, arglist):
return toolset_vcvars
-def _msvc_script_default_toolset(env, msvc, vc_dir, arglist):
+def _msvc_script_default_toolset(env, msvc, vc_dir, arglist, force_toolset):
if msvc.vs_def.vc_buildtools_def.vc_version_numeric < VS2017.vc_buildtools_def.vc_version_numeric:
return None
@@ -697,8 +696,9 @@ def _msvc_script_default_toolset(env, msvc, vc_dir, arglist):
debug('MSVC_VERSION=%s, toolset_default=%s', repr(msvc.version), repr(toolset_default))
- argpair = (SortOrder.TOOLSET, '-vcvars_ver={}'.format(toolset_default))
- arglist.append(argpair)
+ if force_toolset:
+ argpair = (SortOrder.TOOLSET, '-vcvars_ver={}'.format(toolset_default))
+ arglist.append(argpair)
return toolset_default
@@ -874,11 +874,10 @@ def _msvc_process_construction_variables(env):
def msvc_script_arguments(env, version, vc_dir, arg):
- arglist = []
+ arguments = [arg] if arg else []
- if arg:
- argpair = (SortOrder.ARCH, arg)
- arglist.append(argpair)
+ arglist = []
+ arglist_reverse = False
msvc = _msvc_version(version)
@@ -897,7 +896,9 @@ def msvc_script_arguments(env, version, vc_dir, arg):
uwp = None
if user_argstr:
- _user_script_argument_uwp(env, uwp, user_argstr)
+ user_uwp = _user_script_argument_uwp(env, uwp, user_argstr)
+ else:
+ user_uwp = None
is_uwp = True if uwp else False
platform_def = WinSDK.get_msvc_platform(is_uwp)
@@ -915,14 +916,10 @@ def msvc_script_arguments(env, version, vc_dir, arg):
user_toolset = None
if not toolset_version and not user_toolset:
- default_toolset = _msvc_script_default_toolset(env, msvc, vc_dir, arglist)
+ default_toolset = _msvc_script_default_toolset(env, msvc, vc_dir, arglist, _MSVC_FORCE_DEFAULT_TOOLSET)
else:
default_toolset = None
- if _MSVC_FORCE_DEFAULT_TOOLSET:
- if default_toolset:
- toolset_version = default_toolset
-
if user_toolset:
toolset = None
elif toolset_version:
@@ -958,11 +955,18 @@ def msvc_script_arguments(env, version, vc_dir, arg):
if user_argstr:
_user_script_argument_spectre(env, spectre, user_argstr)
- if arglist:
+ if msvc.vs_def.vc_buildtools_def.vc_version == '14.0':
+ if user_uwp and sdk_version and len(arglist) == 2:
+ # VS2015 toolset argument order issue: SDK store => store SDK
+ arglist_reverse = True
+
+ if len(arglist) > 1:
arglist.sort()
- argstr = ' '.join([argpair[-1] for argpair in arglist]).strip()
- else:
- argstr = ''
+ if arglist_reverse:
+ arglist.reverse()
+
+ arguments.extend([argpair[-1] for argpair in arglist])
+ argstr = ' '.join(arguments).strip()
debug('arguments: %s', repr(argstr))
return argstr
diff --git a/test/MSVC/MSVC_SDK_VERSION.py b/test/MSVC/MSVC_SDK_VERSION.py
index 1d9f0f45b..62eaf6e0b 100644
--- a/test/MSVC/MSVC_SDK_VERSION.py
+++ b/test/MSVC/MSVC_SDK_VERSION.py
@@ -87,7 +87,7 @@ if GE_VS2015_versions:
env = Environment(MSVC_VERSION={0}, MSVC_SDK_VERSION={1}, tools=['msvc'])
lib_path = env['ENV']['LIB']
if '\\\\{2}\\\\' not in lib_path:
- raise RuntimeError("{1} not found in lib_path " + lib_path)
+ raise RuntimeError("{1} not found in lib path " + lib_path)
""".format(repr(supported.msvc_version), repr(sdk_version), sdk_version)
))
test.run(arguments='-Q -s', stdout='')
@@ -99,7 +99,7 @@ if GE_VS2015_versions:
env = Environment(MSVC_VERSION={0}, MSVC_SCRIPT_ARGS={1}, tools=['msvc'])
lib_path = env['ENV']['LIB']
if '\\\\{2}\\\\' not in lib_path:
- raise RuntimeError("{1} not found in lib_path " + lib_path)
+ raise RuntimeError("{1} not found in lib path " + lib_path)
""".format(repr(supported.msvc_version), repr(sdk_version), sdk_version)
))
test.run(arguments='-Q -s', stdout='')
diff --git a/test/MSVC/MSVC_SPECTRE_LIBS.py b/test/MSVC/MSVC_SPECTRE_LIBS.py
index d5e57c920..d5b0c4de2 100644
--- a/test/MSVC/MSVC_SPECTRE_LIBS.py
+++ b/test/MSVC/MSVC_SPECTRE_LIBS.py
@@ -58,7 +58,7 @@ if GE_VS2017_versions:
env = Environment(MSVC_VERSION={}, MSVC_SPECTRE_LIBS=True, tools=['msvc'])
lib_path = env['ENV']['LIB']
if '\\\\lib\\\\spectre\\\\' not in lib_path.lower():
- raise RuntimeError("'spectre' not found in lib_path " + lib_path)
+ raise RuntimeError("'spectre' not found in lib path " + lib_path)
""".format(repr(supported.msvc_version))
))
test.run(arguments='-Q -s', stdout='')
@@ -70,7 +70,7 @@ if GE_VS2017_versions:
env = Environment(MSVC_VERSION={}, MSVC_SCRIPT_ARGS='-vcvars_spectre_libs=spectre', tools=['msvc'])
lib_path = env['ENV']['LIB']
if '\\\\lib\\\\spectre\\\\' not in lib_path.lower():
- raise RuntimeError("'spectre' not found in lib_path " + lib_path)
+ raise RuntimeError("'spectre' not found in lib path " + lib_path)
""".format(repr(supported.msvc_version))
))
test.run(arguments='-Q -s', stdout='')
@@ -117,7 +117,7 @@ if GE_VS2017_versions:
env = Environment(MSVC_VERSION={}, MSVC_SPECTRE_LIBS=False, tools=['msvc'])
lib_path = env['ENV']['LIB']
if '\\\\lib\\\\spectre\\\\' in lib_path.lower():
- raise RuntimeError("'spectre' found in lib_path " + lib_path)
+ raise RuntimeError("'spectre' found in lib path " + lib_path)
""".format(repr(supported.msvc_version))
))
test.run(arguments='-Q -s', stdout='')
diff --git a/test/MSVC/MSVC_TOOLSET_VERSION.py b/test/MSVC/MSVC_TOOLSET_VERSION.py
index b01614747..01d43b1f1 100644
--- a/test/MSVC/MSVC_TOOLSET_VERSION.py
+++ b/test/MSVC/MSVC_TOOLSET_VERSION.py
@@ -64,7 +64,7 @@ if GE_VS2017_versions:
env = Environment(MSVC_VERSION={0}, MSVC_TOOLSET_VERSION={1}, tools=['msvc'])
lib_path = env['ENV']['LIB']
if '\\\\{2}\\\\' not in lib_path:
- raise RuntimeError("{1} not found in lib_path " + lib_path)
+ raise RuntimeError("{1} not found in lib path " + lib_path)
""".format(repr(supported.msvc_version), repr(toolset_full_version), toolset_full_version)
))
test.run(arguments='-Q -s', stdout='')
@@ -76,7 +76,7 @@ if GE_VS2017_versions:
env = Environment(MSVC_VERSION={0}, MSVC_SCRIPT_ARGS='-vcvars_ver={1}', tools=['msvc'])
lib_path = env['ENV']['LIB']
if '\\\\{1}\\\\' not in lib_path:
- raise RuntimeError("'{1}' not found in lib_path " + lib_path)
+ raise RuntimeError("'{1}' not found in lib path " + lib_path)
""".format(repr(supported.msvc_version), toolset_full_version)
))
test.run(arguments='-Q -s', stdout='')
diff --git a/test/MSVC/MSVC_UWP_APP.py b/test/MSVC/MSVC_UWP_APP.py
index 6ccd1177f..1f1c230a0 100644
--- a/test/MSVC/MSVC_UWP_APP.py
+++ b/test/MSVC/MSVC_UWP_APP.py
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,190 +20,148 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
-Test the ability to configure the $MSVC_UWP_APP construction variable with
-the desired effect.
+Test the MSVC_UWP_APP construction variable.
"""
import TestSCons
-import SCons.Tool.MSCommon.vc as msvc
-from SCons.Tool.MSCommon.vc import get_msvc_version_numeric
-
-def AreVCStoreLibPathsInLIBPATH(output):
- libpath = None
- msvc_version = None
- UWP_APP = None
- lines = output.splitlines()
- for line in lines:
- if 'env[ENV][LIBPATH]=' in line:
- libpath = line.split('=')[1]
- elif 'env[MSVC_VERSION]=' in line:
- msvc_version = line.split('=')[1]
- elif 'env[ENV][VSCMD_ARG_app_plat]=' in line:
- UWP_APP = line.split('=')[1]
-
- if not libpath or not msvc_version:
- # Couldn't find the libpath or msvc version in the output
- return (False, False, None)
-
- libpaths = libpath.lower().split(';')
- msvc_num = float(get_msvc_version_numeric(msvc_version))
-
- (vclibstore_path_present, vclibstorerefs_path_present) = (False, False)
- for path in libpaths:
- # Look for the Store VC Lib paths in the LIBPATH:
- # [VS install path]\VC\LIB\store[\arch] and
- # [VS install path]\VC\LIB\store\references
- # For example,
- # C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\store\amd64
- # C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\store\references
-
- if msvc_num <= 14:
- if r'vc\lib\store\references' in path:
- vclibstorerefs_path_present = True
- elif r'vc\lib\store' in path:
- vclibstore_path_present = True
- elif msvc_num > 14:
- if UWP_APP == "UWP":
- if(r'\lib\x86\store\references' in path
- or r'\lib\x64\store' in path):
- vclibstorerefs_path_present = True
- vclibstore_path_present = True
-
- return (vclibstore_path_present, vclibstorerefs_path_present, msvc_version)
-
-_python_ = TestSCons._python_
test = TestSCons.TestSCons()
test.skip_if_not_msvc()
-installed_msvc_versions = msvc.get_installed_vcs()
-# MSVC guaranteed to be at least one version on the system or else
-# skip_if_not_msvc() function would have skipped the test
-
-msvc_140 = '14.0' in installed_msvc_versions
-msvc_141 = '14.1' in installed_msvc_versions
-msvc_142 = '14.2' in installed_msvc_versions
-msvc_143 = '14.3' in installed_msvc_versions
-
-if not any((msvc_140, msvc_141, msvc_142, msvc_143)):
- test.skip_test("Available MSVC doesn't support App store\n")
-
-if msvc_140:
- test.write('SConstruct', """\
-if ARGUMENTS.get('MSVC_UWP_APP'):
- help_vars = Variables()
- help_vars.Add(EnumVariable(
- 'MSVC_UWP_APP',
- 'Build a Universal Windows Platform (UWP) Application',
- '0',
- allowed_values=('0', '1')))
-else:
- help_vars = None
-env = Environment(tools=['default', 'msvc'], variables=help_vars, MSVC_VERSION='14.0')
-# Print the ENV LIBPATH to stdout
-print('env[ENV][LIBPATH]=%s' % env.get('ENV').get('LIBPATH'))
-print('env[MSVC_VERSION]=%s' % env.get('MSVC_VERSION'))
-""")
-
- # Test setting MSVC_UWP_APP is '1' (True)
- test.run(arguments = "MSVC_UWP_APP=1")
- (vclibstore_path_present, vclibstorerefs_path_present, msvc_version) = AreVCStoreLibPathsInLIBPATH(test.stdout())
- test.fail_test((vclibstore_path_present is False) or (vclibstorerefs_path_present is False),
- message='VC Store LIBPATHs NOT present when MSVC_UWP_APP=1 (msvc_version=%s)' % msvc_version)
-
- # Test setting MSVC_UWP_APP is '0' (False)
- test.run(arguments = "MSVC_UWP_APP=0")
- (vclibstore_path_present, vclibstorerefs_path_present, msvc_version) = AreVCStoreLibPathsInLIBPATH(test.stdout())
- test.fail_test((vclibstore_path_present is True) or (vclibstorerefs_path_present is True),
- message='VC Store LIBPATHs present when MSVC_UWP_APP=0 (msvc_version=%s)' % msvc_version)
-
- # Test not setting MSVC_UWP_APP
- test.run(arguments = "")
- (vclibstore_path_present, vclibstorerefs_path_present, msvc_version) = AreVCStoreLibPathsInLIBPATH(test.stdout())
- test.fail_test((vclibstore_path_present is True) or (vclibstorerefs_path_present is True),
- message='VC Store LIBPATHs present when MSVC_UWP_APP not set (msvc_version=%s)' % msvc_version)
-
-if msvc_141 or msvc_142 or msvc_143:
- if msvc_143:
- test.write('SConstruct', """\
-if ARGUMENTS.get('MSVC_UWP_APP'):
- help_vars = Variables()
- help_vars.Add(EnumVariable(
- 'MSVC_UWP_APP',
- 'Build a Universal Windows Platform (UWP) Application',
- '0',
- allowed_values=('0', '1')))
-else:
- help_vars = None
-env = Environment(tools=['default', 'msvc'], variables=help_vars, MSVC_VERSION='14.3')
-# Print the ENV LIBPATH to stdout
-print('env[ENV][LIBPATH]=%s' % env.get('ENV').get('LIBPATH'))
-print('env[MSVC_VERSION]=%s' % env.get('MSVC_VERSION'))
-print('env[ENV][VSCMD_ARG_app_plat]=%s' % env.get('ENV').get('VSCMD_ARG_app_plat'))
-""")
- elif msvc_142:
- test.write('SConstruct', """\
-if ARGUMENTS.get('MSVC_UWP_APP'):
- help_vars = Variables()
- help_vars.Add(EnumVariable(
- 'MSVC_UWP_APP',
- 'Build a Universal Windows Platform (UWP) Application',
- '0',
- allowed_values=('0', '1')))
-else:
- help_vars = None
-env = Environment(tools=['default', 'msvc'], variables=help_vars, MSVC_VERSION='14.2')
-# Print the ENV LIBPATH to stdout
-print('env[ENV][LIBPATH]=%s' % env.get('ENV').get('LIBPATH'))
-print('env[MSVC_VERSION]=%s' % env.get('MSVC_VERSION'))
-print('env[ENV][VSCMD_ARG_app_plat]=%s' % env.get('ENV').get('VSCMD_ARG_app_plat'))
-""")
- elif msvc_141:
- test.write('SConstruct', """\
-if ARGUMENTS.get('MSVC_UWP_APP'):
- help_vars = Variables()
- help_vars.Add(EnumVariable(
- 'MSVC_UWP_APP',
- 'Build a Universal Windows Platform (UWP) Application',
- '0',
- allowed_values=('0', '1')))
-else:
- help_vars = None
-env = Environment(tools=['default', 'msvc'], variables=help_vars, MSVC_VERSION='14.1')
-# Print the ENV LIBPATH to stdout
-print('env[ENV][LIBPATH]=%s' % env.get('ENV').get('LIBPATH'))
-print('env[MSVC_VERSION]=%s' % env.get('MSVC_VERSION'))
-print('env[ENV][VSCMD_ARG_app_plat]=%s' % env.get('ENV').get('VSCMD_ARG_app_plat'))
-""")
-
- # Test setting MSVC_UWP_APP is '1' (True)
- test.run(arguments = "MSVC_UWP_APP=1")
- (vclibstore_path_present, vclibstorerefs_path_present, msvc_version) = AreVCStoreLibPathsInLIBPATH(test.stdout())
- test.fail_test((vclibstore_path_present is False) or (vclibstorerefs_path_present is False),
- message='VC Store LIBPATHs NOT present when MSVC_UWP_APP=1 (msvc_version=%s)' % msvc_version)
-
- # Test setting MSVC_UWP_APP is '0' (False)
- test.run(arguments = "MSVC_UWP_APP=0")
- (vclibstore_path_present, vclibstorerefs_path_present, msvc_version) = AreVCStoreLibPathsInLIBPATH(test.stdout())
- test.fail_test((vclibstore_path_present is True) or (vclibstorerefs_path_present is True),
- message='VC Store LIBPATHs NOT present when MSVC_UWP_APP=1 (msvc_version=%s)' % msvc_version)
-
- # Test not setting MSVC_UWP_APP
- test.run(arguments = "")
- (vclibstore_path_present, vclibstorerefs_path_present, msvc_version) = AreVCStoreLibPathsInLIBPATH(test.stdout())
- test.fail_test((vclibstore_path_present is True) or (vclibstorerefs_path_present is True),
- message='VC Store LIBPATHs NOT present when MSVC_UWP_APP=1 (msvc_version=%s)' % msvc_version)
+import textwrap
+import re
+
+from SCons.Tool.MSCommon.vc import get_installed_vcs_components
+
+installed_versions = get_installed_vcs_components()
+
+GE_VS2015_versions = [v for v in installed_versions if v.msvc_vernum >= 14.0]
+LT_VS2015_versions = [v for v in installed_versions if v.msvc_vernum < 14.0]
+
+# Look for the Store VC Lib paths in the LIBPATH:
+# [VS install path]\VC\LIB\store[\arch] and
+# [VS install path]\VC\LIB\store\references
+# For example,
+# C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\store\amd64
+# C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\store\references
+
+re_lib_eq2015_1 = re.compile(r'\\vc\\lib\\store\\references', re.IGNORECASE)
+re_lib_eq2015_2 = re.compile(r'\\vc\\lib\\store', re.IGNORECASE)
+
+re_lib_ge2017_1 = re.compile(r'\\lib\\x86\\store\\references', re.IGNORECASE)
+re_lib_ge2017_2 = re.compile(r'\\lib\\x64\\store', re.IGNORECASE)
+
+def check_libpath(msvc, active, output):
+
+ def _check_libpath(msvc, output):
+ outdict = {key.strip(): val.strip() for key, val in [line.split('|') for line in output.splitlines()]}
+ platform = outdict.get('PLATFORM', '')
+ libpath = outdict.get('LIBPATH', '')
+ n_matches = 0
+ if msvc.msvc_verstr == '14.0':
+ for regex in (re_lib_eq2015_1, re_lib_eq2015_2):
+ if regex.search(libpath):
+ n_matches += 1
+ return (n_matches >= 2, 'store', libpath)
+ elif platform == 'UWP':
+ for regex in (re_lib_ge2017_1, re_lib_ge2017_2):
+ if regex.search(libpath):
+ n_matches += 1
+ return (n_matches > 0, 'uwp', libpath)
+ return (False, 'uwp', libpath)
+
+ found, kind, libpath = _check_libpath(msvc, output)
+
+ failmsg = None
+
+ if active and not found:
+ failmsg = 'msvc version {} {} paths not found in lib path {}'.format(
+ repr(msvc.msvc_version), repr(kind), repr(libpath)
+ )
+ elif not active and found:
+ failmsg = 'msvc version {} {} paths found in lib path {}'.format(
+ repr(msvc.msvc_version), repr(kind), repr(libpath)
+ )
+
+ return failmsg
+
+if GE_VS2015_versions:
+ # VS2015 and later for uwp/store argument
+
+ for supported in GE_VS2015_versions:
+
+ for msvc_uwp_app in (True, '1', False, '0', None):
+
+ active = msvc_uwp_app in (True, '1')
+
+ # uwp using construction variable
+ test.write('SConstruct', textwrap.dedent(
+ """
+ DefaultEnvironment(tools=[])
+ env = Environment(MSVC_VERSION={}, MSVC_UWP_APP={}, tools=['msvc'])
+ print('LIBPATH|' + env['ENV'].get('LIBPATH', ''))
+ print('PLATFORM|' + env['ENV'].get('VSCMD_ARG_app_plat',''))
+ """.format(repr(supported.msvc_version), repr(msvc_uwp_app))
+ ))
+ test.run(arguments='-Q -s', stdout=None)
+ failmsg = check_libpath(supported, active, test.stdout())
+ if failmsg:
+ test.fail_test(message=failmsg)
+
+ if not active:
+ continue
+
+ # error construction variable and script argument
+ test.write('SConstruct', textwrap.dedent(
+ """
+ DefaultEnvironment(tools=[])
+ env = Environment(MSVC_VERSION={}, MSVC_UWP_APP={}, MSVC_SCRIPT_ARGS='store', tools=['msvc'])
+ """.format(repr(supported.msvc_version), repr(msvc_uwp_app))
+ ))
+ test.run(arguments='-Q -s', status=2, stderr=None)
+ if not test.stderr().strip().startswith("MSVCArgumentError: multiple uwp declarations:"):
+ test.fail_test(message='Expected MSVCArgumentError')
+
+ # uwp using script argument
+ test.write('SConstruct', textwrap.dedent(
+ """
+ DefaultEnvironment(tools=[])
+ env = Environment(MSVC_VERSION={}, MSVC_SCRIPT_ARGS='store', tools=['msvc'])
+ print('LIBPATH|' + env['ENV'].get('LIBPATH', ''))
+ print('PLATFORM|' + env['ENV'].get('VSCMD_ARG_app_plat',''))
+ """.format(repr(supported.msvc_version))
+ ))
+ test.run(arguments='-Q -s', stdout=None)
+ failmsg = check_libpath(supported, True, test.stdout())
+ if failmsg:
+ test.fail_test(message=failmsg)
+
+if LT_VS2015_versions:
+ # VS2013 and earlier for uwp/store error
+
+ for unsupported in LT_VS2015_versions:
+
+ for msvc_uwp_app in (True, '1', False, '0', None):
+
+ active = msvc_uwp_app in (True, '1')
+
+ # uwp using construction variable
+ test.write('SConstruct', textwrap.dedent(
+ """
+ DefaultEnvironment(tools=[])
+ env = Environment(MSVC_VERSION={0}, MSVC_UWP_APP={1}, tools=['msvc'])
+ """.format(repr(unsupported.msvc_version), repr(msvc_uwp_app))
+ ))
+ if not active:
+ test.run(arguments='-Q -s', stdout=None)
+ else:
+ test.run(arguments='-Q -s', status=2, stderr=None)
+ expect = 'MSVCArgumentError: MSVC_UWP_APP ({}) constraint violation:'.format(repr(msvc_uwp_app))
+ if not test.stderr().strip().startswith(expect):
+ test.fail_test(message='Expected MSVCArgumentError')
test.pass_test()
-# Local Variables:
-# tab-width:4
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=4 shiftwidth=4: