Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
baulktar 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharlie committed Dec 31, 2021
1 parent 3d652b9 commit e55ff96
Show file tree
Hide file tree
Showing 255 changed files with 20,976 additions and 11,142 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,25 @@ jobs:
baulktar_target: [baulktar-win64, baulktar-win32, baulktar-arm64]
include:
- baulktar_target: baulktar-win64
msvc_arch: amd64
build_dir: build
short_target: win64
- baulktar_target: baulktar-win32
msvc_arch: amd64_x86
build_dir: build.win32
short_target: win32
- baulktar_target: baulktar-arm64
msvc_arch: amd64_arm64
build_dir: build.arm64
short_target: arm64
steps:
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: compile-baulktar
shell: cmd
env:
vc_arch: ${{ matrix.msvc_arch }}
workdir: ${{ matrix.build_dir }}
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch%
mkdir %workdir%
cd %workdir%
set CC=cl
set CXX=cl
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
ninja all
run: pwsh -NoProfile -NoLogo -ExecutionPolicy unrestricted -File "./build.ps1" -Target "${{ matrix.short_target }}"

- name: Package release
if: startsWith(github.ref, 'refs/tags/')
shell: pwsh
# create package and show sha256 hash
run: |
Set-Location ${{ matrix.build_dir }}
Set-Location build
# cleanup zip files
Remove-Item -Force *.zip
cpack -G ZIP
Expand All @@ -67,7 +53,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
file_glob: true
file: ${{ matrix.build_dir}}/BaulkTar-*.zip
file: build/BaulkTar-*.zip
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Author: Force Charlie Copyright (C) 2020. Force Charlie. All Rights Reserved.
# Author: Force Charlie Copyright (C) 2022. Force Charlie. All Rights Reserved.
cmake_minimum_required(VERSION 3.15)
project(BaulkTar)

Expand Down Expand Up @@ -53,8 +53,8 @@ else()
endif()

set(BAULKTAR_VERSION_MAJOR 1)
set(BAULKTAR_VERSION_MINOR 0)
set(BAULKTAR_VERSION_PATCH 4)
set(BAULKTAR_VERSION_MINOR 1)
set(BAULKTAR_VERSION_PATCH 0)
set(PACKAGE_VERSION "${BAULKTAR_VERSION_MAJOR}.${BAULKTAR_VERSION_MINOR}.${BAULKTAR_VERSION_PATCH}")

set(CPACK_PACKAGE_NAME "BaulkTar")
Expand Down
107 changes: 107 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env pwsh
param(
[ValidateSet("win64", "win32", "arm64")]
[string]$Target = "win64"
)

$TargetWithHost64s = @{
"win64" = "amd64";
"win32" = "amd64_x86";
"arm64" = "amd64_arm64";
}

$TargetWithHost = $TargetWithHost64s[$Target]

Function Invoke-BatchFile {
param(
[Parameter(Mandatory = $true)]
[string] $Path,
[string] $Arguments
)
Set-StrictMode -Version Latest
$tempFile = [IO.Path]::GetTempFileName()

cmd.exe /c " `"$Path`" $Arguments && set > `"$tempFile`" " | Out-Host
## Go through the environment variables in the temp file.
## For each of them, set the variable in our local environment.
Get-Content $tempFile | ForEach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}
Remove-Item $tempFile
}

Function Exec {
param(
[string]$FilePath,
[string]$Arguments,
[string]$WD
)
$ProcessInfo = New-Object System.Diagnostics.ProcessStartInfo
$ProcessInfo.FileName = $FilePath
if ([String]::IsNullOrEmpty($WD)) {
$ProcessInfo.WorkingDirectory = $PWD
}
else {
$ProcessInfo.WorkingDirectory = $WD
}
Write-Host "$FilePath $Arguments [$($ProcessInfo.WorkingDirectory)]"
#0x00000000 WindowStyle
$ProcessInfo.Arguments = $Arguments
$ProcessInfo.UseShellExecute = $false ## use createprocess not shellexecute
$Process = New-Object System.Diagnostics.Process
$Process.StartInfo = $ProcessInfo
try {
if ($Process.Start() -eq $false) {
return -1
}
$Process.WaitForExit()
}
catch {
return 127
}
return $Process.ExitCode
}


$VisualCxxBatchFiles = $(
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat",
"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvarsall.bat",
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
)

$VisualCxxBatchFile = $null
foreach ($file in $VisualCxxBatchFiles) {
if (Test-Path $file) {
$VisualCxxBatchFile = $file
break
}
}
if ($null -eq $VisualCxxBatchFile) {
Write-Host -ForegroundColor Red "visual c++ vcvarsall.bat not found"
exit 1
}


Write-Host "call `"$VisualCxxBatchFile`" $TargetWithHost"

Invoke-BatchFile -Path $VisualCxxBatchFile -Arguments $TargetWithHost
$WD = Join-Path -Path $PWD -ChildPath "build"
try {
New-Item -ItemType Directory -Force -Path $WD
}
catch {
Write-Host -ForegroundColor Red "mkdir error $_"
exit 1
}
$env:CC = "cl"
$env:CXX = "cl"
$ExitCode = Exec -FilePath "cmake" -WD $WD -Arguments "-GNinja -DCMAKE_BUILD_TYPE=Release .."
if ($ExitCode -ne 0) {
exit $ExitCode
}
$ExitCode = Exec -FilePath "ninja" -WD $WD -Arguments "all"
if ($ExitCode -ne 0) {
exit $ExitCode
}
2 changes: 1 addition & 1 deletion include/fmt.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.3
8.0.1
Loading

0 comments on commit e55ff96

Please sign in to comment.