File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ libgoengine.h
66libgoengine.so
77goengine
88ctypes
9+ goengine.exe
Original file line number Diff line number Diff line change 1+ # PowerShell build script for GoInGo
2+ Write-Host " Running tests..." - ForegroundColor Green
3+ go test ./ pkg/ ...
4+
5+ if ($LASTEXITCODE -ne 0 ) {
6+ Write-Host " Tests failed. Exiting build process." - ForegroundColor Red
7+ exit 1
8+ }
9+
10+ Write-Host " Building main executable..." - ForegroundColor Green
11+ $env: CGO_ENABLED = " 1"
12+ go build - o goengine.exe ./ cmd/ main.go
13+
14+ Write-Host " Checking CGO availability..." - ForegroundColor Yellow
15+
16+ $cgoEnabled = (go env CGO_ENABLED)
17+ if ($cgoEnabled -eq " 1" ) {
18+ Write-Host " Building shared library..." - ForegroundColor Green
19+ go build - buildmode= c- shared - o libgoengine.so ./ export/ export.go
20+ if ($LASTEXITCODE -eq 0 ) {
21+ Write-Host " Build completed successfully!" - ForegroundColor Green
22+ } else {
23+ Write-Host " Shared library build failed, but main executable was built successfully." - ForegroundColor Yellow
24+ }
25+ } else {
26+ Write-Host " CGO is disabled. Skipping shared library build." - ForegroundColor Yellow
27+ Write-Host " To enable CGO, install a C compiler (like MinGW-w64) and set CGO_ENABLED=1" - ForegroundColor Yellow
28+ }
29+
30+ Write-Host " Build process completed!" - ForegroundColor Green
You can’t perform that action at this time.
0 commit comments