WinRT: removed '-' from build script file names
authorDavid Ludwig <dludwig@pobox.com>
Mon, 03 Nov 2014 13:07:51 -0500
changeset 9217e15f7d963d98
parent 9216 61cf772a4ed3
child 9218 74b8ddd028c7
WinRT: removed '-' from build script file names

Most of the other build scripts don't include a '-' in their file names. This
change makes the WinRT build scripts use the same convention.
build-scripts/winrt-build.bat
build-scripts/winrt-build.ps1
build-scripts/winrtbuild.bat
build-scripts/winrtbuild.ps1
     1.1 --- a/build-scripts/winrt-build.bat	Mon Nov 03 08:58:49 2014 -0500
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,8 +0,0 @@
     1.4 -@ECHO OFF
     1.5 -REM
     1.6 -REM winrt-build.bat: a batch file to help launch the winrt-build.ps1
     1.7 -REM   Powershell script, either from Windows Explorer, or through Buildbot.
     1.8 -REM
     1.9 -SET ThisScriptsDirectory=%~dp0
    1.10 -SET PowerShellScriptPath=%ThisScriptsDirectory%winrt-build.ps1
    1.11 -PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%'";
    1.12 \ No newline at end of file
     2.1 --- a/build-scripts/winrt-build.ps1	Mon Nov 03 08:58:49 2014 -0500
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,225 +0,0 @@
     2.4 -#
     2.5 -# winrt-build.ps1 -- A Powershell script to build all SDL/WinRT variants,
     2.6 -#    across all WinRT platforms, in all of their supported, CPU architectures.
     2.7 -#
     2.8 -# Initial version written by David Ludwig <dludwig@pobox.com>
     2.9 -#
    2.10 -# This script can be launched from Windows Explorer by double-clicking
    2.11 -# on winrt-build.bat
    2.12 -#
    2.13 -# Output will be placed in the following subdirectories of the SDL source
    2.14 -# tree:
    2.15 -#   * VisualC-WinRT\lib\  -- final .dll, .lib, and .pdb files
    2.16 -#   * VisualC-WinRT\obj\  -- intermediate build files
    2.17 -#
    2.18 -# Recommended Dependencies:
    2.19 -#   * Windows 8.1 or higher
    2.20 -#   * Powershell 4.0 or higher (included as part of Windows 8.1)
    2.21 -#   * Visual C++ 2012, for building Windows 8.0 and Windows Phone 8.0 binaries.
    2.22 -#   * Visual C++ 2013, for building Windows 8.1 and Windows Phone 8.1 binaries
    2.23 -#   * SDKs for Windows 8.0, Windows 8.1, Windows Phone 8.0, and
    2.24 -#     Windows Phone 8.1, as needed
    2.25 -#
    2.26 -# Commom parameters/variables may include, but aren't strictly limited to:
    2.27 -#   * PlatformToolset: the name of one of Visual Studio's build platforms.
    2.28 -#     Different PlatformToolsets output different binaries.  One
    2.29 -#     PlatformToolset exists for each WinRT platform.  Possible values
    2.30 -#     may include:
    2.31 -#       - "v110": Visual Studio 2012 build tools, plus the Windows 8.0 SDK
    2.32 -#       - "v110_wp80": Visual Studio 2012 build tools, plus the Windows Phone 8.0 SDK
    2.33 -#       - "v120": Visual Studio 2013 build tools, plus the Windows 8.1 SDK
    2.34 -#       - "v120_wp81": Visual Studio 2013 build tools, plus the Windows Phone 8.1 SDK
    2.35 -#   * VSProjectPath: the full path to a Visual Studio or Visual C++ project file
    2.36 -#   * VSProjectName: the internal name of a Visual Studio or Visual C++ project
    2.37 -#     file.  Some of Visual Studio's own build tools use this name when
    2.38 -#     calculating paths for build-output.
    2.39 -#   * Platform: a Visual Studio platform name, which often maps to a CPU
    2.40 -#     CPU architecture.  Possible values may include: "Win32" (for 32-bit x86),
    2.41 -#     "ARM", or "x64" (for 64-bit x86).
    2.42 -#
    2.43 -
    2.44 -
    2.45 -# Gets the .bat file that sets up an MSBuild environment, given one of
    2.46 -# Visual Studio's, "PlatformToolset"s.
    2.47 -function Get-MSBuild-Env-Launcher
    2.48 -{
    2.49 -    param(
    2.50 -        [Parameter(Mandatory=$true,Position=1)][string]$PlatformToolset
    2.51 -    )
    2.52 -
    2.53 -    if ($PlatformToolset -eq "v110") {      # Windows 8.0 (not Windows Phone), via VS 2012
    2.54 -        return "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
    2.55 -    }
    2.56 -    if ($PlatformToolset -eq "v110_wp80") { # Windows Phone 8.0, via VS 2012
    2.57 -        return "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\vcvarsphoneall.bat"
    2.58 -    }
    2.59 -    if ($PlatformToolset -eq "v120") {      # Windows 8.1 (not Windows Phone), via VS 2013
    2.60 -        return "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
    2.61 -    }
    2.62 -    if ($PlatformToolset -eq "v120_wp81") { # Windows Phone 8.1, via VS 2013
    2.63 -        return "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
    2.64 -    }
    2.65 -    return ""
    2.66 -}
    2.67 -
    2.68 -# Gets a string that identifies the build-variant of SDL/WinRT that is specific
    2.69 -# to a particular Visual Studio PlatformToolset.
    2.70 -function Get-SDL-WinRT-Variant-Name
    2.71 -{
    2.72 -    param(
    2.73 -        [Parameter(Mandatory=$true,Position=1)][string]$PlatformToolset,
    2.74 -
    2.75 -        # If true, append a string to this function's output, identifying the
    2.76 -        # build-variant's minimum-supported version of Visual Studio.
    2.77 -        [switch]$IncludeVSSuffix = $false
    2.78 -    )
    2.79 -
    2.80 -    if ($PlatformToolset -eq "v110") {      # Windows 8.0 (not Windows Phone), via VS 2012 project files
    2.81 -        if ($IncludeVSSuffix) {
    2.82 -            return "WinRT80_VS2012"
    2.83 -        } else {
    2.84 -            return "WinRT80"
    2.85 -        }
    2.86 -    }
    2.87 -    if ($PlatformToolset -eq "v110_wp80") { # Windows Phone 8.0, via VS 2012 project files
    2.88 -        if ($IncludeVSSuffix) {
    2.89 -            return "WinPhone80_VS2012"
    2.90 -        } else {
    2.91 -            return "WinPhone80"
    2.92 -        }
    2.93 -    }
    2.94 -    if ($PlatformToolset -eq "v120") {      # Windows 8.1 (not Windows Phone), via VS 2013 project files
    2.95 -        if ($IncludeVSSuffix) {
    2.96 -            return "WinRT81_VS2013"
    2.97 -        } else {
    2.98 -            return "WinRT81"
    2.99 -        }
   2.100 -    }
   2.101 -    if ($PlatformToolset -eq "v120_wp81") { # Windows Phone 8.1, via VS 2013 project files
   2.102 -        if ($IncludeVSSuffix) {
   2.103 -            return "WinPhone81_VS2013"
   2.104 -        } else {
   2.105 -            return "WinPhone81"
   2.106 -        }
   2.107 -    }
   2.108 -    return ""
   2.109 -}
   2.110 -
   2.111 -# Returns the internal name of a Visual Studio Project.
   2.112 -#
   2.113 -# The internal name of a VS Project is encoded inside the project file
   2.114 -# itself, inside a set of <ProjectName></ProjectName> XML tags.
   2.115 -function Get-VS-ProjectName
   2.116 -{
   2.117 -    param(
   2.118 -        [Parameter(Mandatory=$true,Position=1)]$VSProjectPath
   2.119 -    )
   2.120 -
   2.121 -    # For now, just do a regex for the project name:
   2.122 -    $matches = (Get-Content $VSProjectPath | Select-String -Pattern ".*<ProjectName>([^<]+)<.*").Matches
   2.123 -    foreach ($match in $matches) {
   2.124 -        if ($match.Groups.Count -ge 1) {
   2.125 -            return $match.Groups[1].Value
   2.126 -        }
   2.127 -    }
   2.128 -    return $null
   2.129 -}
   2.130 -
   2.131 -# Build a specific variant of SDL/WinRT
   2.132 -function Build-SDL-WinRT-Variant
   2.133 -{
   2.134 -    #
   2.135 -    # Read in arguments:
   2.136 -    #
   2.137 -    param (
   2.138 -        # name of an SDL project file, minus extensions and
   2.139 -        # platform-identifying suffixes
   2.140 -        [Parameter(Mandatory=$true,Position=1)][string]$SDLProjectName,
   2.141 -
   2.142 -        [Parameter(Mandatory=$true,Position=2)][string]$PlatformToolset,
   2.143 -
   2.144 -        [Parameter(Mandatory=$true,Position=3)][string]$Platform
   2.145 -    )
   2.146 -
   2.147 -    #
   2.148 -    # Derive other properties from read-in arguments:
   2.149 -    #
   2.150 -
   2.151 -    # The .bat file to setup a platform-appropriate MSBuild environment:
   2.152 -    $BatchFileForMSBuildEnv = Get-MSBuild-Env-Launcher $PlatformToolset
   2.153 -
   2.154 -    # The full path to the VS Project that'll be built:
   2.155 -    $VSProjectPath = "$PSScriptRoot\..\VisualC-WinRT\$(Get-SDL-WinRT-Variant-Name $PlatformToolset -IncludeVSSuffix)\$SDLProjectName-$(Get-SDL-WinRT-Variant-Name $PlatformToolset).vcxproj"
   2.156 -
   2.157 -    # The internal name of the VS Project, used in some post-build steps:
   2.158 -    $VSProjectName = Get-VS-ProjectName $VSProjectPath
   2.159 -
   2.160 -    # Where to place output binaries (.dll, .lib, and .pdb files):
   2.161 -    $OutDir = "$PSScriptRoot\..\VisualC-WinRT\lib\$PlatformToolset\$Platform"
   2.162 -
   2.163 -    # Where to place intermediate build files:
   2.164 -    $IntermediateDir = "$PSScriptRoot\..\VisualC-WinRT\obj\$SDLProjectName-$(Get-SDL-WinRT-Variant-Name $PlatformToolset)\$Platform"
   2.165 -
   2.166 -    #
   2.167 -    # Build the VS Project:
   2.168 -    #
   2.169 -    cmd.exe /c " ""$BatchFileForMSBuildEnv"" x86 & msbuild ""$VSProjectPath"" /p:Platform=$Platform /p:OutDir=""$OutDir\\"" /p:IntDir=""$IntermediateDir\\""" | Out-Host
   2.170 -    $BuildResult = $?
   2.171 -
   2.172 -    #
   2.173 -    # Move .dll files into place.  This fixes a problem whereby MSBuild may
   2.174 -    # put output files into a sub-directory of $OutDir, rather than $OutDir
   2.175 -    # itself.
   2.176 -    #
   2.177 -    if (Test-Path "$OutDir\$VSProjectName\") {
   2.178 -        Move-Item -Force "$OutDir\$VSProjectName\*" "$OutDir"
   2.179 -    }
   2.180 -
   2.181 -    #
   2.182 -    # Clean up unneeded files in $OutDir:
   2.183 -    #
   2.184 -    if (Test-Path "$OutDir\$VSProjectName\") {
   2.185 -        Remove-Item -Recurse "$OutDir\$VSProjectName"
   2.186 -    }
   2.187 -    Remove-Item "$OutDir\*.exp"
   2.188 -    Remove-Item "$OutDir\*.ilk"
   2.189 -    Remove-Item "$OutDir\*.pri"
   2.190 -
   2.191 -    #
   2.192 -    # All done.  Indicate success, or failure, to the caller:
   2.193 -    #
   2.194 -    #echo "RESULT: $BuildResult" | Out-Host
   2.195 -    return $BuildResult
   2.196 -}
   2.197 -
   2.198 -
   2.199 -#
   2.200 -# Build each variant, with corresponding .dll, .lib, and .pdb files:
   2.201 -#
   2.202 -$DidAnyFail = $false
   2.203 -
   2.204 -# Build for Windows Phone 8.0, via VC++ 2012:
   2.205 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v110_wp80" "ARM"))   { $DidAnyFail = $true }
   2.206 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v110_wp80" "Win32")) { $DidAnyFail = $true }
   2.207 -
   2.208 -# Build for Windows Phone 8.1, via VC++ 2013:
   2.209 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v120_wp81" "ARM"))   { $DidAnyFail = $true }
   2.210 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v120_wp81" "Win32")) { $DidAnyFail = $true }
   2.211 -
   2.212 -# Build for Windows 8.0 and Windows RT 8.0, via VC++ 2012:
   2.213 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "ARM"))        { $DidAnyFail = $true }
   2.214 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "Win32"))      { $DidAnyFail = $true }
   2.215 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "x64"))        { $DidAnyFail = $true }
   2.216 -
   2.217 -# Build for Windows 8.1 and Windows RT 8.1, via VC++ 2013:
   2.218 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "ARM"))        { $DidAnyFail = $true }
   2.219 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "Win32"))      { $DidAnyFail = $true }
   2.220 -if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "x64"))        { $DidAnyFail = $true }
   2.221 -
   2.222 -# Let the script's caller know whether or not any errors occurred.
   2.223 -# Exit codes compatible with Buildbot are used (1 for error, 0 for success).
   2.224 -if ($DidAnyFail -eq $true) {
   2.225 -    exit 1
   2.226 -} else {
   2.227 -    exit 0
   2.228 -}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/build-scripts/winrtbuild.bat	Mon Nov 03 13:07:51 2014 -0500
     3.3 @@ -0,0 +1,8 @@
     3.4 +@ECHO OFF
     3.5 +REM
     3.6 +REM winrtbuild.bat: a batch file to help launch the winrtbuild.ps1
     3.7 +REM   Powershell script, either from Windows Explorer, or through Buildbot.
     3.8 +REM
     3.9 +SET ThisScriptsDirectory=%~dp0
    3.10 +SET PowerShellScriptPath=%ThisScriptsDirectory%winrtbuild.ps1
    3.11 +PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%'";
    3.12 \ No newline at end of file
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/build-scripts/winrtbuild.ps1	Mon Nov 03 13:07:51 2014 -0500
     4.3 @@ -0,0 +1,225 @@
     4.4 +#
     4.5 +# winrtbuild.ps1 -- A Powershell script to build all SDL/WinRT variants,
     4.6 +#    across all WinRT platforms, in all of their supported, CPU architectures.
     4.7 +#
     4.8 +# Initial version written by David Ludwig <dludwig@pobox.com>
     4.9 +#
    4.10 +# This script can be launched from Windows Explorer by double-clicking
    4.11 +# on winrtbuild.bat
    4.12 +#
    4.13 +# Output will be placed in the following subdirectories of the SDL source
    4.14 +# tree:
    4.15 +#   * VisualC-WinRT\lib\  -- final .dll, .lib, and .pdb files
    4.16 +#   * VisualC-WinRT\obj\  -- intermediate build files
    4.17 +#
    4.18 +# Recommended Dependencies:
    4.19 +#   * Windows 8.1 or higher
    4.20 +#   * Powershell 4.0 or higher (included as part of Windows 8.1)
    4.21 +#   * Visual C++ 2012, for building Windows 8.0 and Windows Phone 8.0 binaries.
    4.22 +#   * Visual C++ 2013, for building Windows 8.1 and Windows Phone 8.1 binaries
    4.23 +#   * SDKs for Windows 8.0, Windows 8.1, Windows Phone 8.0, and
    4.24 +#     Windows Phone 8.1, as needed
    4.25 +#
    4.26 +# Commom parameters/variables may include, but aren't strictly limited to:
    4.27 +#   * PlatformToolset: the name of one of Visual Studio's build platforms.
    4.28 +#     Different PlatformToolsets output different binaries.  One
    4.29 +#     PlatformToolset exists for each WinRT platform.  Possible values
    4.30 +#     may include:
    4.31 +#       - "v110": Visual Studio 2012 build tools, plus the Windows 8.0 SDK
    4.32 +#       - "v110_wp80": Visual Studio 2012 build tools, plus the Windows Phone 8.0 SDK
    4.33 +#       - "v120": Visual Studio 2013 build tools, plus the Windows 8.1 SDK
    4.34 +#       - "v120_wp81": Visual Studio 2013 build tools, plus the Windows Phone 8.1 SDK
    4.35 +#   * VSProjectPath: the full path to a Visual Studio or Visual C++ project file
    4.36 +#   * VSProjectName: the internal name of a Visual Studio or Visual C++ project
    4.37 +#     file.  Some of Visual Studio's own build tools use this name when
    4.38 +#     calculating paths for build-output.
    4.39 +#   * Platform: a Visual Studio platform name, which often maps to a CPU
    4.40 +#     CPU architecture.  Possible values may include: "Win32" (for 32-bit x86),
    4.41 +#     "ARM", or "x64" (for 64-bit x86).
    4.42 +#
    4.43 +
    4.44 +
    4.45 +# Gets the .bat file that sets up an MSBuild environment, given one of
    4.46 +# Visual Studio's, "PlatformToolset"s.
    4.47 +function Get-MSBuild-Env-Launcher
    4.48 +{
    4.49 +    param(
    4.50 +        [Parameter(Mandatory=$true,Position=1)][string]$PlatformToolset
    4.51 +    )
    4.52 +
    4.53 +    if ($PlatformToolset -eq "v110") {      # Windows 8.0 (not Windows Phone), via VS 2012
    4.54 +        return "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
    4.55 +    }
    4.56 +    if ($PlatformToolset -eq "v110_wp80") { # Windows Phone 8.0, via VS 2012
    4.57 +        return "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\vcvarsphoneall.bat"
    4.58 +    }
    4.59 +    if ($PlatformToolset -eq "v120") {      # Windows 8.1 (not Windows Phone), via VS 2013
    4.60 +        return "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
    4.61 +    }
    4.62 +    if ($PlatformToolset -eq "v120_wp81") { # Windows Phone 8.1, via VS 2013
    4.63 +        return "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
    4.64 +    }
    4.65 +    return ""
    4.66 +}
    4.67 +
    4.68 +# Gets a string that identifies the build-variant of SDL/WinRT that is specific
    4.69 +# to a particular Visual Studio PlatformToolset.
    4.70 +function Get-SDL-WinRT-Variant-Name
    4.71 +{
    4.72 +    param(
    4.73 +        [Parameter(Mandatory=$true,Position=1)][string]$PlatformToolset,
    4.74 +
    4.75 +        # If true, append a string to this function's output, identifying the
    4.76 +        # build-variant's minimum-supported version of Visual Studio.
    4.77 +        [switch]$IncludeVSSuffix = $false
    4.78 +    )
    4.79 +
    4.80 +    if ($PlatformToolset -eq "v110") {      # Windows 8.0 (not Windows Phone), via VS 2012 project files
    4.81 +        if ($IncludeVSSuffix) {
    4.82 +            return "WinRT80_VS2012"
    4.83 +        } else {
    4.84 +            return "WinRT80"
    4.85 +        }
    4.86 +    }
    4.87 +    if ($PlatformToolset -eq "v110_wp80") { # Windows Phone 8.0, via VS 2012 project files
    4.88 +        if ($IncludeVSSuffix) {
    4.89 +            return "WinPhone80_VS2012"
    4.90 +        } else {
    4.91 +            return "WinPhone80"
    4.92 +        }
    4.93 +    }
    4.94 +    if ($PlatformToolset -eq "v120") {      # Windows 8.1 (not Windows Phone), via VS 2013 project files
    4.95 +        if ($IncludeVSSuffix) {
    4.96 +            return "WinRT81_VS2013"
    4.97 +        } else {
    4.98 +            return "WinRT81"
    4.99 +        }
   4.100 +    }
   4.101 +    if ($PlatformToolset -eq "v120_wp81") { # Windows Phone 8.1, via VS 2013 project files
   4.102 +        if ($IncludeVSSuffix) {
   4.103 +            return "WinPhone81_VS2013"
   4.104 +        } else {
   4.105 +            return "WinPhone81"
   4.106 +        }
   4.107 +    }
   4.108 +    return ""
   4.109 +}
   4.110 +
   4.111 +# Returns the internal name of a Visual Studio Project.
   4.112 +#
   4.113 +# The internal name of a VS Project is encoded inside the project file
   4.114 +# itself, inside a set of <ProjectName></ProjectName> XML tags.
   4.115 +function Get-VS-ProjectName
   4.116 +{
   4.117 +    param(
   4.118 +        [Parameter(Mandatory=$true,Position=1)]$VSProjectPath
   4.119 +    )
   4.120 +
   4.121 +    # For now, just do a regex for the project name:
   4.122 +    $matches = (Get-Content $VSProjectPath | Select-String -Pattern ".*<ProjectName>([^<]+)<.*").Matches
   4.123 +    foreach ($match in $matches) {
   4.124 +        if ($match.Groups.Count -ge 1) {
   4.125 +            return $match.Groups[1].Value
   4.126 +        }
   4.127 +    }
   4.128 +    return $null
   4.129 +}
   4.130 +
   4.131 +# Build a specific variant of SDL/WinRT
   4.132 +function Build-SDL-WinRT-Variant
   4.133 +{
   4.134 +    #
   4.135 +    # Read in arguments:
   4.136 +    #
   4.137 +    param (
   4.138 +        # name of an SDL project file, minus extensions and
   4.139 +        # platform-identifying suffixes
   4.140 +        [Parameter(Mandatory=$true,Position=1)][string]$SDLProjectName,
   4.141 +
   4.142 +        [Parameter(Mandatory=$true,Position=2)][string]$PlatformToolset,
   4.143 +
   4.144 +        [Parameter(Mandatory=$true,Position=3)][string]$Platform
   4.145 +    )
   4.146 +
   4.147 +    #
   4.148 +    # Derive other properties from read-in arguments:
   4.149 +    #
   4.150 +
   4.151 +    # The .bat file to setup a platform-appropriate MSBuild environment:
   4.152 +    $BatchFileForMSBuildEnv = Get-MSBuild-Env-Launcher $PlatformToolset
   4.153 +
   4.154 +    # The full path to the VS Project that'll be built:
   4.155 +    $VSProjectPath = "$PSScriptRoot\..\VisualC-WinRT\$(Get-SDL-WinRT-Variant-Name $PlatformToolset -IncludeVSSuffix)\$SDLProjectName-$(Get-SDL-WinRT-Variant-Name $PlatformToolset).vcxproj"
   4.156 +
   4.157 +    # The internal name of the VS Project, used in some post-build steps:
   4.158 +    $VSProjectName = Get-VS-ProjectName $VSProjectPath
   4.159 +
   4.160 +    # Where to place output binaries (.dll, .lib, and .pdb files):
   4.161 +    $OutDir = "$PSScriptRoot\..\VisualC-WinRT\lib\$PlatformToolset\$Platform"
   4.162 +
   4.163 +    # Where to place intermediate build files:
   4.164 +    $IntermediateDir = "$PSScriptRoot\..\VisualC-WinRT\obj\$SDLProjectName-$(Get-SDL-WinRT-Variant-Name $PlatformToolset)\$Platform"
   4.165 +
   4.166 +    #
   4.167 +    # Build the VS Project:
   4.168 +    #
   4.169 +    cmd.exe /c " ""$BatchFileForMSBuildEnv"" x86 & msbuild ""$VSProjectPath"" /p:Platform=$Platform /p:OutDir=""$OutDir\\"" /p:IntDir=""$IntermediateDir\\""" | Out-Host
   4.170 +    $BuildResult = $?
   4.171 +
   4.172 +    #
   4.173 +    # Move .dll files into place.  This fixes a problem whereby MSBuild may
   4.174 +    # put output files into a sub-directory of $OutDir, rather than $OutDir
   4.175 +    # itself.
   4.176 +    #
   4.177 +    if (Test-Path "$OutDir\$VSProjectName\") {
   4.178 +        Move-Item -Force "$OutDir\$VSProjectName\*" "$OutDir"
   4.179 +    }
   4.180 +
   4.181 +    #
   4.182 +    # Clean up unneeded files in $OutDir:
   4.183 +    #
   4.184 +    if (Test-Path "$OutDir\$VSProjectName\") {
   4.185 +        Remove-Item -Recurse "$OutDir\$VSProjectName"
   4.186 +    }
   4.187 +    Remove-Item "$OutDir\*.exp"
   4.188 +    Remove-Item "$OutDir\*.ilk"
   4.189 +    Remove-Item "$OutDir\*.pri"
   4.190 +
   4.191 +    #
   4.192 +    # All done.  Indicate success, or failure, to the caller:
   4.193 +    #
   4.194 +    #echo "RESULT: $BuildResult" | Out-Host
   4.195 +    return $BuildResult
   4.196 +}
   4.197 +
   4.198 +
   4.199 +#
   4.200 +# Build each variant, with corresponding .dll, .lib, and .pdb files:
   4.201 +#
   4.202 +$DidAnyFail = $false
   4.203 +
   4.204 +# Build for Windows Phone 8.0, via VC++ 2012:
   4.205 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110_wp80" "ARM"))   { $DidAnyFail = $true }
   4.206 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110_wp80" "Win32")) { $DidAnyFail = $true }
   4.207 +
   4.208 +# Build for Windows Phone 8.1, via VC++ 2013:
   4.209 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120_wp81" "ARM"))   { $DidAnyFail = $true }
   4.210 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120_wp81" "Win32")) { $DidAnyFail = $true }
   4.211 +
   4.212 +# Build for Windows 8.0 and Windows RT 8.0, via VC++ 2012:
   4.213 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "ARM"))        { $DidAnyFail = $true }
   4.214 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "Win32"))      { $DidAnyFail = $true }
   4.215 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v110" "x64"))        { $DidAnyFail = $true }
   4.216 +
   4.217 +# Build for Windows 8.1 and Windows RT 8.1, via VC++ 2013:
   4.218 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "ARM"))        { $DidAnyFail = $true }
   4.219 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "Win32"))      { $DidAnyFail = $true }
   4.220 +if ( ! (Build-SDL-WinRT-Variant "SDL" "v120" "x64"))        { $DidAnyFail = $true }
   4.221 +
   4.222 +# Let the script's caller know whether or not any errors occurred.
   4.223 +# Exit codes compatible with Buildbot are used (1 for error, 0 for success).
   4.224 +if ($DidAnyFail -eq $true) {
   4.225 +    exit 1
   4.226 +} else {
   4.227 +    exit 0
   4.228 +}