Skip to content

Commit 5f52204

Browse files
committed
add support for building x64 binaries
1 parent b129ecb commit 5f52204

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

build.ps1

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
<#
22
This script builds libiconv,libxml2 and libxslt
33
#>
4+
Param([switch]$x64)
45

56
$ErrorActionPreference = "Stop"
67
Import-Module Pscx
78

9+
$x64Dir = If($x64) { "\x64" } Else { "" }
10+
$distname = If($x64) { "win64" } Else { "win32" }
11+
812
cd $PSScriptRoot
913

1014
# Change theset two lines to change VS version
11-
Import-VisualStudioVars -VisualStudioVersion 140 -Architecture x86
15+
if($x64) {
16+
Import-VisualStudioVars -VisualStudioVersion 140 -Architecture x64
17+
} else {
18+
Import-VisualStudioVars -VisualStudioVersion 140 -Architecture x86
19+
}
1220

1321
cd .\libiconv\MSVC14
1422
msbuild libiconv.sln /p:Configuration=Release
15-
# /p:Platform=Win32
16-
# msbuild libiconv.sln /p:Configuration=Release /p:Platform=x64
17-
$iconvLib = Join-Path (pwd) libiconv_static\Release
23+
$iconvLib = Join-Path (pwd) libiconv_static$x64Dir\Release
1824
$iconvInc = Join-Path (pwd) ..\source\include
1925
# Make sure that libiconv.(lib|exp) is included
20-
Copy-Item -Force (Join-Path (pwd) Release\*) -Destination $iconvLib
26+
Copy-Item -Force (Join-Path (pwd) .\$x64Dir\Release\*) -Destination $iconvLib
2127
cd ..\..
2228

2329
cd .\libxml2\win32
@@ -32,6 +38,9 @@ cscript configure.js lib="$iconvLib;$xmlLib" include="$iconvInc;$xmlInc" vcmanif
3238
nmake
3339
cd ..\..
3440

41+
cd .\zlib
42+
nmake -f win32/Makefile.msc
43+
cd ..
3544

3645
# Bundle releases
3746
Function BundleRelease($name, $lib, $inc)
@@ -57,6 +66,7 @@ New-Item -ItemType Directory .\dist
5766
Dir $iconvLib\libiconv* | Copy-Item -Force -Destination {Join-Path $iconvLib ($_.Name -replace "libiconv","iconv") }
5867
Remove-Item (Join-Path $iconvLib iconv_static.tlog)
5968

60-
BundleRelease "iconv-1.14.win32" (dir $iconvLib\iconv* | Where-Object {$_.Name -notmatch "^libiconv"}) (dir $iconvInc\*)
61-
BundleRelease "libxml2-2.9.4.win32" (dir $xmlLib\*) (Get-Item $xmlInc\libxml)
62-
BundleRelease "libxslt-1.1.29.win32" (dir .\libxslt\win32\bin.msvc\*) (Get-Item .\libxslt\libxslt,.\libxslt\libexslt)
69+
BundleRelease "iconv-1.14.$distname" (dir $iconvLib\iconv* | Where-Object {$_.Name -notmatch "^libiconv"}) (dir $iconvInc\*)
70+
BundleRelease "libxml2-2.9.4.$distname" (dir $xmlLib\*) (Get-Item $xmlInc\libxml)
71+
BundleRelease "libxslt-1.1.29.$distname" (dir .\libxslt\win32\bin.msvc\*) (Get-Item .\libxslt\libxslt,.\libxslt\libexslt)
72+
BundleRelease "zlib-1.2.8.$distname" (Get-Item .\zlib\*.*) (Get-Item .\zlib\zconf.h,.\zlib\zlib.h)

clean.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This script resets all submodules to a clean state so that no previous build art
55
$ErrorActionPreference = "Stop"
66
cd $PSScriptRoot
77

8-
ForEach ($repo in "libiconv","libxslt","libxml2") {
8+
ForEach ($repo in "libiconv","libxslt","libxml2","zlib") {
99
echo "Cleaning up $repo..."
1010
cd $repo
1111
Get-ChildItem -Exclude .git . | Remove-Item -Recurse

0 commit comments

Comments
 (0)