Skip to content

Commit

Permalink
Improved support for clean build for submodule-based projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismile committed Dec 18, 2024
1 parent 4cb1473 commit a8a72da
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 12 additions & 1 deletion build-msvc.bat
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,21 @@ if %clean% == true (
echo ------------------------
echo cleaning up old files
echo ------------------------
rd /s /q "third_party\sgl"
rd /s /q "third_party\vcpkg"
for /d %%G in (".build*") do rd /s /q "%%~G"
rd /s /q "Shipping"

:: https://stackoverflow.com/questions/5626879/how-to-find-if-a-file-contains-a-given-string-using-windows-command-line
find /c "sgl" .gitmodules >NUL
if %errorlevel% equ 1 goto notfound
rd /s /q "third_party\sgl\install"
for /d %%G in ("third_party\sgl\.build*") do rd /s /q "%%~G"
goto done
:notfound
rd /s /q "third_party\sgl"
goto done
:done

git submodule update --init --recursive
)

Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ if [ $clean = true ]; then
echo "------------------------"
echo " cleaning up old files "
echo "------------------------"
rm -rf third_party/sgl/ third_party/vcpkg/ .build_release/ .build_debug/ Shipping/
rm -rf third_party/vcpkg/ .build_release/ .build_debug/ Shipping/
if grep -wq "sgl" .gitmodules; then
rm -rf third_party/sgl/install/ third_party/sgl/.build_release/ third_party/sgl/.build_debug/
else
rm -rf third_party/sgl/
fi
git submodule update --init --recursive
fi

Expand Down

0 comments on commit a8a72da

Please sign in to comment.