Initial commit

This commit is contained in:
zhangshun
2026-06-01 15:55:59 +08:00
commit 40f9bdb590
1799 changed files with 362227 additions and 0 deletions

42
scripts/test_compile.ps1 Normal file
View File

@@ -0,0 +1,42 @@
# test_compile.ps1 - 测试编译
Write-Host "=== 测试编译 ===" -ForegroundColor Cyan
# 设置环境
$EmsdkPath = "E:\emsdk"
if (-not (Test-Path $EmsdkPath)) {
Write-Host "[错误] 未找到 Emscripten" -ForegroundColor Red
exit 1
}
$env:PATH = "$EmsdkPath\upstream\emscripten;$env:PATH"
# 测试 1: 编译 math_utils.cpp
Write-Host "[ ] 测试编译 math_utils.cpp..." -ForegroundColor Cyan
emcc src/math_utils.cpp -I./src -s WASM=1 -c -o test_math.o 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host "[✓] math_utils.cpp 编译成功" -ForegroundColor Green
} else {
Write-Host "[✗] math_utils.cpp 编译失败" -ForegroundColor Red
}
# 测试 2: 编译 smart_json_wrapper.cpp
Write-Host "[ ] 测试编译 smart_json_wrapper.cpp..." -ForegroundColor Cyan
emcc src/smart_json_wrapper.cpp -I./src -s WASM=1 -c -o test_wrapper.o 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host "[✓] smart_json_wrapper.cpp 编译成功" -ForegroundColor Green
} else {
Write-Host "[✗] smart_json_wrapper.cpp 编译失败" -ForegroundColor Red
}
# 测试 3: 编译 main.cpp
Write-Host "[ ] 测试编译 main.cpp..." -ForegroundColor Cyan
emcc src/main.cpp -I./src -s WASM=1 -c -o test_main.o 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host "[✓] main.cpp 编译成功" -ForegroundColor Green
} else {
Write-Host "[✗] main.cpp 编译失败" -ForegroundColor Red
}
# 清理
Remove-Item test_*.o -ErrorAction SilentlyContinue