2017-08-29 22:04:58 +08:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
set PROTOBUF_SRC_DIR=Proto
|
|
|
|
set PROTOBUF_CPP_OUT_DIR=CarlaServer/source/carla/server
|
2018-10-26 00:49:17 +08:00
|
|
|
set PROTOBUF_PY_OUT_DIR=../Deprecated/PythonClient/carla
|
2017-08-29 22:04:58 +08:00
|
|
|
set PROTO_BASENAME=carla_server
|
|
|
|
|
|
|
|
if "%1" == "--clean" (
|
|
|
|
rem Delete existing ones.
|
2018-03-10 01:38:55 +08:00
|
|
|
@rd /s /q "%PROTOBUF_CPP_OUT_DIR%\carla_server.pb.h" 2>nul
|
|
|
|
@rd /s /q "%PROTOBUF_CPP_OUT_DIR%\carla_server.pb.cc" 2>nul
|
|
|
|
@rd /s /q "%PROTOBUF_PY_OUT_DIR%\carla_server_pb2.py" 2>nul
|
2017-08-29 22:04:58 +08:00
|
|
|
goto end
|
|
|
|
)
|
|
|
|
|
|
|
|
set PROTOC=Build\protobuf-install\bin\protoc.exe
|
|
|
|
|
|
|
|
if exist %PROTOC% (
|
|
|
|
|
|
|
|
echo Compiling %PROTO_BASENAME%.proto...
|
|
|
|
|
|
|
|
%PROTOC% ^
|
|
|
|
-I=%PROTOBUF_SRC_DIR% ^
|
|
|
|
--cpp_out=%PROTOBUF_CPP_OUT_DIR% ^
|
2017-11-19 00:58:54 +08:00
|
|
|
--python_out=%PROTOBUF_PY_OUT_DIR% ^
|
2017-08-29 22:04:58 +08:00
|
|
|
%PROTOBUF_SRC_DIR%/%PROTO_BASENAME%.proto
|
|
|
|
|
|
|
|
echo done.
|
|
|
|
|
|
|
|
) else (
|
|
|
|
|
|
|
|
echo ERROR: Missing protobuf compiler: %PROTOC%
|
|
|
|
exit /b
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
:end
|