Skip to content

Commit

Permalink
Add build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Nov 7, 2024
1 parent 69dd28c commit daf97d4
Show file tree
Hide file tree
Showing 4 changed files with 468 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
.vs
tests/_test*
build
.build
CMakeSettings.json
14 changes: 14 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off

rem If cl.exe is not available, we try to run the vcvars64.bat
where cl.exe >nul 2>nul
if %errorlevel%==1 (
@call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
)

rem Add an extra path element which will be invalidated by Git Bash.
rem In this way we avoid invalidating the PATH location where cl.exe is.
set PATH=.;%PATH%

powershell -ExecutionPolicy Bypass -File .\build.ps1 %*
pause
15 changes: 15 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if (Test-Path "$env:ProgramFiles\Git\bin") {
$env:Path = "$env:ProgramFiles\Git\bin;$env:ProgramFiles\Git\mingw64\bin" + $env:Path
}
elseif (Test-Path "$env:ProgramFiles(x86)\Git\bin") {
$env:Path = "$env:ProgramFiles(x86)\Git\bin;$env:ProgramFiles(x86)\Git\mingw64\bin;" + $env:Path
}

try {
sh.exe build.sh $args
}
catch {
echo "bash.exe doesn't found"
echo "`r`nInstall Git Bash from:"
echo "`r`n https://gitforwindows.org/`r`n"
}
Loading

0 comments on commit daf97d4

Please sign in to comment.