Skip to content

Commit

Permalink
Add arm64 library builds and upgrade to VS 2019 for all compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
niyas-sait committed Oct 7, 2021
1 parent 1a4e58f commit 890d692
Show file tree
Hide file tree
Showing 9 changed files with 883 additions and 16 deletions.
16 changes: 13 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
environment:
matrix:
- Architecture: x86
Compiler: vs2015
Compiler: vs2019
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- Architecture: x64
Compiler: vs2015
Compiler: vs2019
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- Architecture: arm64
Compiler: vs2019
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- Architecture: x86
Compiler: vs2008
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- Architecture: x64
Compiler: vs2008
PYTHON_ARCH: 64
PATCH_VS2008: True
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

install:
- cmd: git submodule update --init --recursive
- ps: install-module pscx -scope CurrentUser -AllowClobber
Expand All @@ -26,9 +34,11 @@ build_script:
- ps: >-
$x64param = if ($env:Architecture -eq 'x64') { $true } else { $false }
$arm64param = if ($env:Architecture -eq 'arm64') { $true } else { $false }
$vs2008param = if ($env:Compiler -eq 'vs2008') { $true } else { $false }
.\build.ps1 -x64:$x64param -vs2008:$vs2008param
.\build.ps1 -x64:$x64param -arm64:$arm64param -vs2008:$vs2008param
test: off
test_script:
Expand Down
41 changes: 28 additions & 13 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,46 @@ This script builds libiconv,libxml2 and libxslt
#>
Param(
[switch]$x64,
[switch]$arm64,
[switch]$vs2008
)

$ErrorActionPreference = "Stop"
Import-Module Pscx

$x64Dir = If($x64) { "\x64" } Else { "" }
$distname = If($x64) { "win64" } Else { "win32" }
$platDir = If($x64) { "\x64" } ElseIf ($arm64) { "\arm64" } Else { "" }
$distname = If($x64) { "win64" } ElseIf($arm64) { "win-arm64" } Else { "win32" }
If($vs2008) { $distname = "vs2008.$distname" }
$vcvarsarch = If($x64) { "amd64" } Else { "x86" }
$vsver = If($vs2008) { "90" } Else { "140" }

Set-Location $PSScriptRoot
If($vs2008) {
$vcvarsarch = If($x64) { "amd64" } Else { "x86" }
Import-VisualStudioVars -VisualStudioVersion "90" -Architecture $vcvarsarch
} Else {
$vcvarsarch = If($x64) { "x86_amd64" } ElseIf ($arm64) { "x86_arm64" } Else { "32" }
cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars$vcvarsarch.bat`" && set > %temp%\vcvars$vcvarsarch.txt"
Get-Content "$env:temp\vcvars$vcvarsarch.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}
}

Import-VisualStudioVars -VisualStudioVersion $vsver -Architecture $vcvarsarch
Set-Location $PSScriptRoot

if($vs2008) {
Set-Location .\libiconv\MSVC9
$vcarch = If($x64) { "x64" } Else {"Win32"}
vcbuild libiconv_static\libiconv_static.vcproj "Release|$vcarch"
$iconvLib = Join-Path (pwd) libiconv_static$platDir\Release
} else {
Set-Location .\libiconv\MSVC14
msbuild libiconv.sln /p:Configuration=Release /t:libiconv_static
Set-Location .\libiconv_msvc16\
msbuild libiconv_static\libiconv_static.vcxproj /p:Configuration=Release
$iconvLib = Join-Path (pwd) libiconv_static$platDir\Release
}
$iconvLib = Join-Path (pwd) libiconv_static$x64Dir\Release
$iconvInc = Join-Path (pwd) ..\source\include
Set-Location ..\..

$iconvInc = Join-Path $PSScriptRoot libiconv\source\include

Set-Location $PSScriptRoot

Set-Location .\zlib
Start-Process -NoNewWindow -Wait nmake "-f win32/Makefile.msc zlib.lib"
Expand All @@ -49,8 +62,10 @@ cscript configure.js lib="$zlibLib;$iconvLib;$xmlLib" include="$zlibInc;$iconvIn
Start-Process -NoNewWindow -Wait nmake "libxslta libexslta"
Set-Location ..\..

# Pushed by Import-VisualStudioVars
Pop-EnvironmentBlock
if($vs2008) {
# Pushed by Import-VisualStudioVars
Pop-EnvironmentBlock
}

# Bundle releases
Function BundleRelease($name, $lib, $inc)
Expand Down
40 changes: 40 additions & 0 deletions libiconv_msvc16/libiconv-64.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* Resources for libiconv.dll */
/* There are 4 occurrences of the version number in this file. */

#include <winver.h>

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,14,0,0
PRODUCTVERSION 1,14,0,0
FILEFLAGSMASK 0x3fL /* VS_FFI_FILEFLAGSMASK */
#ifdef _DEBUG
FILEFLAGS 0x1L /* VS_FF_DEBUG */
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x10004L /* VOS_DOS_WINDOWS32 */
FILETYPE 0x2L /* VFT_DLL */
FILESUBTYPE 0x0L /* VFT2_UNKNOWN */
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "04090000" /* Lang = US English, Charset = ASCII */
BEGIN
VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\0"
VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "LGPLed libiconv for Windows XP 64 and Vista 64\0"
VALUE "FileVersion", "1.12\0"
VALUE "InternalName", "libiconv.dll\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2005\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "iconv.dll\0"
VALUE "ProductName", "libiconv: character set conversion library\0"
VALUE "ProductVersion", "1.12\0"
VALUE "SpecialBuild", "Built for http://php.net with MSVC9-x64\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0 /* US English, ASCII */
END
END
43 changes: 43 additions & 0 deletions libiconv_msvc16/libiconv.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Resources for iconv.dll */

#include <winver.h>

#define PACKAGE_VERSION_MAJOR 1
#define PACKAGE_VERSION_MINOR 14
#define PACKAGE_VERSION_SUBMINOR 0
#define PACKAGE_VERSION_STRING "1.14"

VS_VERSION_INFO VERSIONINFO
FILEVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0
PRODUCTVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0
FILEFLAGSMASK 0x3fL /* VS_FFI_FILEFLAGSMASK */
#ifdef _DEBUG
FILEFLAGS 0x1L /* VS_FF_DEBUG */
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x10004L /* VOS_DOS_WINDOWS32 */
FILETYPE 0x2L /* VFT_DLL */
FILESUBTYPE 0x0L /* VFT2_UNKNOWN */
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "04090000" /* Lang = US English, Charset = ASCII */
BEGIN
VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\0"
VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "LGPLed libiconv for Windows NT/2000/XP/Vista/7 and Windows 95/98/ME\0"
VALUE "FileVersion", PACKAGE_VERSION_STRING "\0"
VALUE "InternalName", "iconv.dll\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2009\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "iconv.dll\0"
VALUE "ProductName", "libiconv: character set conversion library\0"
VALUE "ProductVersion", PACKAGE_VERSION_STRING "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0 /* US English, ASCII */
END
END
50 changes: 50 additions & 0 deletions libiconv_msvc16/libiconv.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31424.327
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiconv_static", "libiconv_static\libiconv_static.vcxproj", "{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiconv_dll", "libiconv_dll\libiconv_dll.vcxproj", "{7EA4EC62-EA19-4ACC-86E2-0513E381292B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|ARM64 = Release|ARM64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Debug|ARM64.ActiveCfg = Debug|ARM64
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Debug|ARM64.Build.0 = Debug|ARM64
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Debug|Win32.ActiveCfg = Debug|Win32
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Debug|Win32.Build.0 = Debug|Win32
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Debug|x64.ActiveCfg = Debug|x64
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Debug|x64.Build.0 = Debug|x64
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Release|ARM64.ActiveCfg = Release|ARM64
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Release|ARM64.Build.0 = Release|ARM64
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Release|Win32.ActiveCfg = Release|Win32
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Release|Win32.Build.0 = Release|Win32
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Release|x64.ActiveCfg = Release|x64
{F9C13A95-C7EB-40F3-A599-3695C1E0CF38}.Release|x64.Build.0 = Release|x64
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Debug|ARM64.ActiveCfg = Debug|ARM64
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Debug|ARM64.Build.0 = Debug|ARM64
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Debug|Win32.ActiveCfg = Debug|Win32
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Debug|Win32.Build.0 = Debug|Win32
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Debug|x64.ActiveCfg = Debug|x64
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Debug|x64.Build.0 = Debug|x64
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Release|ARM64.ActiveCfg = Release|ARM64
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Release|ARM64.Build.0 = Release|ARM64
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Release|Win32.ActiveCfg = Release|Win32
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Release|Win32.Build.0 = Release|Win32
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Release|x64.ActiveCfg = Release|x64
{7EA4EC62-EA19-4ACC-86E2-0513E381292B}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3828A197-E059-48CC-B70C-A009922772AD}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 890d692

Please sign in to comment.