From 506a8fefa9fa26a057e1464be2db8680b90339b4 Mon Sep 17 00:00:00 2001 From: Ibrahim Esmat Date: Fri, 21 Jul 2017 10:54:55 -0700 Subject: Windows: Added the capability to build Windows Store Compatible libraries that can be used with Universal Windows Platform (UWP) Apps and published to the Windows Store --- src/CHANGES.txt | 4 ++++ src/engine/SCons/Tool/MSCommon/vc.py | 21 ++++++++++++++------- src/engine/SCons/Tool/msvc.xml | 25 +++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 5be0399..c585eaf 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -11,6 +11,10 @@ NOTE: This is a major release. You should expect that some targets may rebuild Significant changes in some python action signatures. Also switching between PY 2 and PY 3.5, 3.6 may cause rebuilds. In no case should rebuilds not happen. + From Ibrahim Esmat: + - Added the capability to build Windows Store Compatible libraries that can be used + with Universal Windows Platform (UWP) Apps and published to the store + From Richard West: - Added nested / namespace tool support - Added a small fix to the python3 tool loader when loading a tool as a package diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 7b8dd9d..ff48e01 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -82,7 +82,7 @@ _ARCH_TO_CANONICAL = { "itanium" : "ia64", "x86" : "x86", "x86_64" : "amd64", - "x86_amd64" : "x86_amd64", # Cross compile to 64 bit from 32bits + "x86_amd64" : "x86_amd64", # Cross compile to 64 bit from 32bits } # Given a (host, target) tuple, return the argument for the bat file. Both host @@ -185,18 +185,17 @@ _VCVER_TO_PRODUCT_DIR = { } def msvc_version_to_maj_min(msvc_version): - msvc_version_numeric = ''.join([x for x in msvc_version if x in string_digits + '.']) t = msvc_version_numeric.split(".") if not len(t) == 2: - raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) + raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) try: - maj = int(t[0]) - min = int(t[1]) - return maj, min + maj = int(t[0]) + min = int(t[1]) + return maj, min except ValueError as e: - raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) + raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) def is_host_target_supported(host_target, msvc_version): """Return True if the given (host, target) tuple is supported given the @@ -435,6 +434,14 @@ def msvc_find_valid_batch_script(env,version): (host_target, version) SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target] + + # Get just version numbers + maj, min = msvc_version_to_maj_min(version) + # VS2015+ + if maj >= 14: + if env.get('UWP_APP') == '1': + # Initialize environment variables with store/universal paths + arg += ' store' # Try to locate a batch file for this host/target platform combo try: diff --git a/src/engine/SCons/Tool/msvc.xml b/src/engine/SCons/Tool/msvc.xml index 2b4619e..18f4fb6 100644 --- a/src/engine/SCons/Tool/msvc.xml +++ b/src/engine/SCons/Tool/msvc.xml @@ -352,6 +352,8 @@ constructor; setting it later has no effect. Valid values for Windows are +14.0, +14.0Exp, 12.0, 12.0Exp, 11.0, @@ -440,4 +442,27 @@ For example, if you want to compile 64-bit binaries, you would set + + + +Build libraries for a Universal Windows Platform (UWP) Application. + + + +If &cv-UWP_APP; is set, the Visual Studio environment will be set up to point +to the Windows Store compatible libraries and Visual Studio runtimes. In doing so, +any libraries that are built will be able to be used in a UWP App and published +to the Windows Store. +This flag will only have an effect with Visual Studio 2015+. +This variable must be passed as an argument to the Environment() +constructor; setting it later has no effect. + + + +Valid values are '1' or '0' + + + + + -- cgit v0.12