Skip to content

Commit

Permalink
BUILD: Build CTAN asy for windows in build-asymptote.ps1.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamievlin committed Sep 4, 2024
1 parent bbfb13a commit f05b0fe
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions build-scripts/build-asymptote.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,40 +131,54 @@ Pop-Location


# ----------------------------------------------------
# build C++ side
Import-VisualStudioVars -Architecture x64
Push-EnvironmentBlock

function buildAsy($preset, $cfgDir) {
# build C++ side
Import-VisualStudioVars -Architecture x64
Push-EnvironmentBlock
$env:ASY_VERSION_OVERRIDE = $Version
if ($useToolsCacheVcpkg)
{
$env:VCPKG_ROOT = $vcpkgToolsCacheLoc
}
Push-Location asymptote
cmake --preset msvc/release-with-external-doc-files
cmake --preset $preset
Pop-Location

$asymptoteCmakeConfigurationDir="asymptote/cmake-build-msvc/release"
cmake --build $asymptoteCmakeConfigurationDir --target asy-pre-nsis-targets -j
cmake --build $cfgDir --target asy-pre-nsis-targets -j
Pop-EnvironmentBlock # ASY_VERSION_OVERRIDE, VCPKG_ROOT
Pop-EnvironmentBlock # Visual studio vars
# install to pre-installation root
cmake --install $asymptoteCmakeConfigurationDir --component asy-pre-nsis
}

Pop-EnvironmentBlock # ASY_VERSION_OVERRIDE, VCPKG_ROOT
Pop-EnvironmentBlock # Visual studio vars
buildAsy msvc/release-with-external-doc-files asymptote/cmake-build-msvc/release
cmake --install asymptote/cmake-build-msvc/release --component asy-pre-nsis

# ------------------------------------------------------
# Generate NSIS installer file
& ./asymptote/cmake-install-w32-nsis-release/build-asy-installer.ps1 "$makeNsisLoc"


$asySetupFile="./asymptote/cmake-install-w32-nsis-release/asymptote-$Version-setup.exe"

if (Test-Path -PathType leaf "asymptote-$Version-setup.exe")
{
Write-Host "Found old setup file. Will delete the file."
Remove-Item -Force "asymptote-$Version-setup.exe"
}

if (Test-Path -PathType leaf $asySetupFile)
{
Copy-Item $asySetupFile .
Copy-Item $asySetupFile . -Force
}
else
{
Write-Error "Asymptote setup file not built."
Break
}

# TODO: Also handle CTAN builds
# ------------------------------------------------------
# building for CTAN

buildAsy msvc/release-with-external-doc-file-ctan asymptote/cmake-build-msvc/release
New-Item -ItemType Directory -Path CTAN -Force
Copy-Item asymptote/cmake-build-msvc/release/asy.exe -Destination CTAN/asy.exe

0 comments on commit f05b0fe

Please sign in to comment.