Skip to content

Commit c987e6b

Browse files
committed
Add Visual Studio 2008 support
This will allow outputting builds of the libraries for building lxml for Python 2.6 or Python 2.7.
1 parent 6cce97f commit c987e6b

2 files changed

Lines changed: 37 additions & 13 deletions

File tree

appveyor.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
11
environment:
22
matrix:
33
- Architecture: x86
4+
Compiler: vs2015
45
- Architecture: x64
6+
Compiler: vs2015
7+
- Architecture: x86
8+
Compiler: vs2008
9+
- Architecture: x64
10+
Compiler: vs2008
11+
PYTHON_ARCH: 64
12+
PATCH_VS2008: True
513
install:
614
- cmd: git submodule update --init --recursive
715
- ps: install-module pscx -scope CurrentUser
16+
- ps: >-
17+
if ($env:PATCH_VS2008 -eq 'True') {
18+
# http://scikit-ci-addons.readthedocs.io/en/latest/addons.html#patch-vs2008-py
19+
C:\Python27\python -m pip install scikit-ci-addons
20+
C:\Python27\python -m ci_addons appveyor/patch_vs2008
21+
# http://help.appveyor.com/discussions/kb/38-visual-studio-2008-64-bit-builds
22+
Copy-Item "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat"
23+
}
824
build: off
925
build_script:
1026
- ps: >-
11-
if ($env:Architecture -eq 'x64') {
12-
.\build.ps1 -x64
13-
} else {
14-
.\build.ps1
15-
}
27+
$x64param = if ($env:Architecture -eq 'x64') { $true } else { $false }
28+
29+
$vs2008param = if ($env:Compiler -eq 'vs2008') { $true } else { $false }
30+
31+
.\build.ps1 -x64:$x64param -vs2008:$vs2008param
32+
1633
test: off
1734
test_script:
1835
- ps: Get-ChildItem dist\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

build.ps1

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
<#
22
This script builds libiconv,libxml2 and libxslt
33
#>
4-
Param([switch]$x64)
4+
Param(
5+
[switch]$x64,
6+
[switch]$vs2008
7+
)
58

69
$ErrorActionPreference = "Stop"
710
Import-Module Pscx
811

912
$x64Dir = If($x64) { "\x64" } Else { "" }
1013
$distname = If($x64) { "win64" } Else { "win32" }
14+
If($vs2008) { $distname = "vs2008.$distname" }
15+
$vcvarsarch = If($x64) { "amd64" } Else { "x86" }
16+
$vsver = If($vs2008) { "90" } Else { "140" }
1117

1218
Set-Location $PSScriptRoot
1319

14-
# Change theset two lines to change VS version
15-
if($x64) {
16-
Import-VisualStudioVars -VisualStudioVersion 140 -Architecture x64
20+
Import-VisualStudioVars -VisualStudioVersion $vsver -Architecture $vcvarsarch
21+
22+
if($vs2008) {
23+
Set-Location .\libiconv\MSVC9
24+
$vcarch = If($x64) { "x64" } Else {"Win32"}
25+
vcbuild libiconv_static\libiconv_static.vcproj "Release|$vcarch"
1726
} else {
18-
Import-VisualStudioVars -VisualStudioVersion 140 -Architecture x86
27+
Set-Location .\libiconv\MSVC14
28+
msbuild libiconv.sln /p:Configuration=Release /t:libiconv_static
1929
}
20-
21-
Set-Location .\libiconv\MSVC14
22-
msbuild libiconv.sln /p:Configuration=Release /t:libiconv_static
2330
$iconvLib = Join-Path (pwd) libiconv_static$x64Dir\Release
2431
$iconvInc = Join-Path (pwd) ..\source\include
2532
Set-Location ..\..

0 commit comments

Comments
 (0)