1f540a430SEd Maste # Copyright (c) 2021 Yubico AB. All rights reserved. 2f540a430SEd Maste # Use of this source code is governed by a BSD-style 3f540a430SEd Maste # license that can be found in the LICENSE file. 4f540a430SEd Maste 5f540a430SEd Maste $ErrorActionPreference = "Stop" 6f540a430SEd Maste $Architectures = @('x64', 'Win32', 'ARM64', 'ARM') 7f540a430SEd Maste $InstallPrefixes = @('Win64', 'Win32', 'ARM64', 'ARM') 8f540a430SEd Maste $Types = @('dynamic', 'static') 9f540a430SEd Maste $Config = 'Release' 10*3e696dfbSEd Maste $LibCrypto = '47' 11*3e696dfbSEd Maste $SDK = '143' 12f540a430SEd Maste 13f540a430SEd Maste . "$PSScriptRoot\const.ps1" 14f540a430SEd Maste 15f540a430SEd Maste foreach ($Arch in $Architectures) { 16f540a430SEd Maste foreach ($Type in $Types) { 17f540a430SEd Maste ./build.ps1 -Arch ${Arch} -Type ${Type} -Config ${Config} 18f540a430SEd Maste } 19f540a430SEd Maste } 20f540a430SEd Maste 21f540a430SEd Maste foreach ($InstallPrefix in $InstallPrefixes) { 22f540a430SEd Maste foreach ($Type in $Types) { 23f540a430SEd Maste New-Item -Type Directory ` 24f540a430SEd Maste "${OUTPUT}/pkg/${InstallPrefix}/${Config}/v${SDK}/${Type}" 25f540a430SEd Maste } 26f540a430SEd Maste } 27f540a430SEd Maste 28f540a430SEd Maste Function Package-Headers() { 29f540a430SEd Maste Copy-Item "${OUTPUT}\x64\dynamic\include" -Destination "${OUTPUT}\pkg" ` 30f540a430SEd Maste -Recurse -ErrorAction Stop 31f540a430SEd Maste } 32f540a430SEd Maste 33f540a430SEd Maste Function Package-Dynamic(${SRC}, ${DEST}) { 34f540a430SEd Maste Copy-Item "${SRC}\bin\cbor.dll" "${DEST}" 35f540a430SEd Maste Copy-Item "${SRC}\lib\cbor.lib" "${DEST}" 36f540a430SEd Maste Copy-Item "${SRC}\bin\zlib1.dll" "${DEST}" 37f540a430SEd Maste Copy-Item "${SRC}\lib\zlib.lib" "${DEST}" 38f540a430SEd Maste Copy-Item "${SRC}\bin\crypto-${LibCrypto}.dll" "${DEST}" 39f540a430SEd Maste Copy-Item "${SRC}\lib\crypto-${LibCrypto}.lib" "${DEST}" 40f540a430SEd Maste Copy-Item "${SRC}\bin\fido2.dll" "${DEST}" 41f540a430SEd Maste Copy-Item "${SRC}\lib\fido2.lib" "${DEST}" 42f540a430SEd Maste } 43f540a430SEd Maste 44f540a430SEd Maste Function Package-Static(${SRC}, ${DEST}) { 45f540a430SEd Maste Copy-Item "${SRC}/lib/cbor.lib" "${DEST}" 46f540a430SEd Maste Copy-Item "${SRC}/lib/zlib.lib" "${DEST}" 47f540a430SEd Maste Copy-Item "${SRC}/lib/crypto-${LibCrypto}.lib" "${DEST}" 48f540a430SEd Maste Copy-Item "${SRC}/lib/fido2_static.lib" "${DEST}/fido2.lib" 49f540a430SEd Maste } 50f540a430SEd Maste 51f540a430SEd Maste Function Package-PDBs(${SRC}, ${DEST}) { 52*3e696dfbSEd Maste Copy-Item "${SRC}\${LIBRESSL}\crypto\crypto_obj.dir\${Config}\crypto_obj.pdb" ` 53f540a430SEd Maste "${DEST}\crypto-${LibCrypto}.pdb" 54f540a430SEd Maste Copy-Item "${SRC}\${LIBCBOR}\src\cbor.dir\${Config}\vc${SDK}.pdb" ` 55f540a430SEd Maste "${DEST}\cbor.pdb" 56f540a430SEd Maste Copy-Item "${SRC}\${ZLIB}\zlib.dir\${Config}\vc${SDK}.pdb" ` 57f540a430SEd Maste "${DEST}\zlib.pdb" 58f540a430SEd Maste Copy-Item "${SRC}\src\fido2_shared.dir\${Config}\vc${SDK}.pdb" ` 59f540a430SEd Maste "${DEST}\fido2.pdb" 60f540a430SEd Maste } 61f540a430SEd Maste 62*3e696dfbSEd Maste Function Package-StaticPDBs(${SRC}, ${DEST}) { 63*3e696dfbSEd Maste Copy-Item "${SRC}\${LIBRESSL}\crypto\Release\crypto-${LibCrypto}.pdb" ` 64*3e696dfbSEd Maste "${DEST}\crypto-${LibCrypto}.pdb" 65*3e696dfbSEd Maste Copy-Item "${SRC}\${LIBCBOR}\src\Release\cbor.pdb" ` 66*3e696dfbSEd Maste "${DEST}\cbor.pdb" 67*3e696dfbSEd Maste Copy-Item "${SRC}\${ZLIB}\Release\zlibstatic.pdb" ` 68*3e696dfbSEd Maste "${DEST}\zlib.pdb" 69*3e696dfbSEd Maste Copy-Item "${SRC}\src\Release\fido2_static.pdb" ` 70*3e696dfbSEd Maste "${DEST}\fido2.pdb" 71*3e696dfbSEd Maste } 72*3e696dfbSEd Maste 73f540a430SEd Maste Function Package-Tools(${SRC}, ${DEST}) { 74f540a430SEd Maste Copy-Item "${SRC}\tools\${Config}\fido2-assert.exe" ` 75f540a430SEd Maste "${DEST}\fido2-assert.exe" 76f540a430SEd Maste Copy-Item "${SRC}\tools\${Config}\fido2-cred.exe" ` 77f540a430SEd Maste "${DEST}\fido2-cred.exe" 78f540a430SEd Maste Copy-Item "${SRC}\tools\${Config}\fido2-token.exe" ` 79f540a430SEd Maste "${DEST}\fido2-token.exe" 80f540a430SEd Maste } 81f540a430SEd Maste 82f540a430SEd Maste Package-Headers 83f540a430SEd Maste 84f540a430SEd Maste for ($i = 0; $i -lt $Architectures.Length; $i++) { 85f540a430SEd Maste $Arch = $Architectures[$i] 86f540a430SEd Maste $InstallPrefix = $InstallPrefixes[$i] 87f540a430SEd Maste Package-Dynamic "${OUTPUT}\${Arch}\dynamic" ` 88f540a430SEd Maste "${OUTPUT}\pkg\${InstallPrefix}\${Config}\v${SDK}\dynamic" 89f540a430SEd Maste Package-PDBs "${BUILD}\${Arch}\dynamic" ` 90f540a430SEd Maste "${OUTPUT}\pkg\${InstallPrefix}\${Config}\v${SDK}\dynamic" 91f540a430SEd Maste Package-Tools "${BUILD}\${Arch}\dynamic" ` 92f540a430SEd Maste "${OUTPUT}\pkg\${InstallPrefix}\${Config}\v${SDK}\dynamic" 93f540a430SEd Maste Package-Static "${OUTPUT}\${Arch}\static" ` 94f540a430SEd Maste "${OUTPUT}\pkg\${InstallPrefix}\${Config}\v${SDK}\static" 95*3e696dfbSEd Maste Package-StaticPDBs "${BUILD}\${Arch}\static" ` 96*3e696dfbSEd Maste "${OUTPUT}\pkg\${InstallPrefix}\${Config}\v${SDK}\static" 97f540a430SEd Maste } 98