From e326c1d556770634246bebad2d82e3c646dea2e0 Mon Sep 17 00:00:00 2001 From: otavepto <153766569+otavepto@users.noreply.github.com> Date: Fri, 29 Dec 2023 08:42:18 +0200 Subject: [PATCH] don't cleanup protoc generated files, because VScode gets confused and cannot find files/types --- build_linux.sh | 7 ++++--- build_win.bat | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build_linux.sh b/build_linux.sh index 8368eed3..6e21827c 100644 --- a/build_linux.sh +++ b/build_linux.sh @@ -373,7 +373,6 @@ function build_for () { function cleanup () { rm -f -r "$build_temp_dir" - rm -f -r "$protoc_out_dir" } if [[ "$CLEAN_BUILD" = "1" ]]; then @@ -393,9 +392,10 @@ fi ### x32 build cleanup -mkdir -p "$protoc_out_dir" echo // invoking protobuf compiler - 32 +rm -f -r "$protoc_out_dir" +mkdir -p "$protoc_out_dir" "$protoc_exe_32" ./dll/*.proto -I./dll/ --cpp_out="$protoc_out_dir/" last_code=$((last_code + $?)) echo; echo; @@ -450,9 +450,10 @@ fi ### x64 build cleanup -mkdir -p "$protoc_out_dir" echo // invoking protobuf compiler - 64 +rm -f -r "$protoc_out_dir" +mkdir -p "$protoc_out_dir" "$protoc_exe_64" ./dll/*.proto -I./dll/ --cpp_out="$protoc_out_dir/" last_code=$((last_code + $?)) echo; echo; diff --git a/build_win.bat b/build_win.bat index a32e048f..cb9ca203 100644 --- a/build_win.bat +++ b/build_win.bat @@ -243,7 +243,6 @@ setlocal echo // cleaning up to build 32 call :cleanup -mkdir "%protoc_out_dir%" call build_win_set_env.bat 32 || ( endlocal @@ -253,6 +252,8 @@ call build_win_set_env.bat 32 || ( ) echo // invoking protobuf compiler - 32 +rmdir /s /q "%protoc_out_dir%" >nul 2>&1 +mkdir "%protoc_out_dir%" "%protoc_exe_32%" .\dll\net.proto -I.\dll\ --cpp_out="%protoc_out_dir%\\" || ( endlocal call :err_msg "Protobuf compiler failed - 32" @@ -365,7 +366,6 @@ setlocal echo // cleaning up to build 64 call :cleanup -mkdir "%protoc_out_dir%" call build_win_set_env.bat 64 || ( endlocal @@ -375,6 +375,8 @@ call build_win_set_env.bat 64 || ( ) echo // invoking protobuf compiler - 64 +rmdir /s /q "%protoc_out_dir%" >nul 2>&1 +mkdir "%protoc_out_dir%" "%protoc_exe_64%" .\dll\net.proto -I.\dll\ --cpp_out="%protoc_out_dir%\\" || ( endlocal call :err_msg "Protobuf compiler failed - 64" @@ -734,7 +736,6 @@ endlocal & exit /b %_exit% del /f /q *.pdb >nul 2>&1 del /f /q *.ilk >nul 2>&1 rmdir /s /q "%build_temp_dir%" >nul 2>&1 - rmdir /s /q "%protoc_out_dir%" >nul 2>&1 rmdir /s /q "%win_resources_out_dir%" >nul 2>&1 for %%A in ("ilk" "lib" "exp") do ( del /f /s /q "%build_root_dir%\*.%%~A" >nul 2>&1