Skip to content

Commit

Permalink
Clean up generate.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
SpexGuy committed Jul 1, 2022
1 parent 208f975 commit d8b08b8
Showing 1 changed file with 15 additions and 25 deletions.
40 changes: 15 additions & 25 deletions generate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

git submodule update --init --recursive

:LUA_GENERATE
where gcc || goto NO_GCC
where luajit || goto NO_LUAJIT
where gcc || goto NO_GCC
where luajit || goto NO_LUAJIT
where python || goto NO_PYTHON

:LUA_GENERATE
pushd "%~dp0\cimgui\generator"
del ..\..\cimgui.cpp
del ..\..\cimgui.h
Expand All @@ -14,37 +15,26 @@ git submodule update --init --recursive
copy ..\cimgui.h ..\..\zig-imgui\cimgui.h
popd

goto PYTHON_GENERATE

:NO_LUAJIT
echo Couldn't find LuaJIT, make sure it is installed and on your path.
exit /b 1

:NO_GCC
echo Couldn't find gcc, make sure it is installed and on your path.
exit /b 1

:NO_BUILD
:: build_lib.bat prints the specific error that prevented the build
echo Skipping library build.
goto PYTHON_GENERATE

:PYTHON_GENERATE
where python || goto NO_PYTHON
python "%~dp0\generate.py"
goto CLEANUP

:CLEANUP
pushd "%~dp0\cimgui"
git restore .
del generator\preprocesed.h
popd
goto DONE

:NO_PYTHON
echo Couldn't find python, make sure it is installed and on your path.
goto DONE

:DONE
exit /b 0

:NO_LUAJIT
echo Couldn't find LuaJIT, make sure it is installed and on your path.
exit /b 1

:NO_GCC
echo Couldn't find gcc, make sure it is installed and on your path.
exit /b 1

:NO_PYTHON
echo Couldn't find python, make sure it is installed and on your path.
exit /b 1

0 comments on commit d8b08b8

Please sign in to comment.