diff --git a/build.cmd b/build.cmd index a726e5653..e808dc51e 100644 --- a/build.cmd +++ b/build.cmd @@ -46,8 +46,9 @@ if ERRORLEVEL 1 ( ) REM //---------- get rpclib ---------- +set RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec IF NOT EXIST external\rpclib mkdir external\rpclib -IF NOT EXIST external\rpclib\rpclib-2.2.1 ( +IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( REM //leave some blank lines because powershell shows download banner at top of console ECHO( ECHO( @@ -56,7 +57,7 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 ( ECHO Downloading rpclib ECHO ***************************************************************************************** @echo on - powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/rpclib/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip }" + powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/qchateau/rpclib/archive/%RPC_VERSION%.zip -OutFile external\rpclib.zip }" @echo off REM //remove any previous versions @@ -67,7 +68,7 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 ( REM //Don't fail the build if the high-poly car is unable to be downloaded REM //Instead, just notify users that the gokart will be used. - IF NOT EXIST external\rpclib\rpclib-2.2.1 ( + IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( ECHO Unable to download high-polycount SUV. Your AirSim build will use the default vehicle. goto :buildfailed ) @@ -75,8 +76,8 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 ( REM //---------- Build rpclib ------------ ECHO Starting cmake to build rpclib... -IF NOT EXIST external\rpclib\rpclib-2.2.1\build mkdir external\rpclib\rpclib-2.2.1\build -cd external\rpclib\rpclib-2.2.1\build +IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION%\build mkdir external\rpclib\rpclib-%RPC_VERSION%\build +cd external\rpclib\rpclib-%RPC_VERSION%\build REM cmake -G"Visual Studio 14 2015 Win64" .. cmake -G"Visual Studio 15 2017 Win64" .. @@ -97,15 +98,15 @@ set RPCLIB_TARGET_LIB=AirLib\deps\rpclib\lib\x64 if NOT exist %RPCLIB_TARGET_LIB% mkdir %RPCLIB_TARGET_LIB% set RPCLIB_TARGET_INCLUDE=AirLib\deps\rpclib\include if NOT exist %RPCLIB_TARGET_INCLUDE% mkdir %RPCLIB_TARGET_INCLUDE% -robocopy /MIR external\rpclib\rpclib-2.2.1\include %RPCLIB_TARGET_INCLUDE% +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\include %RPCLIB_TARGET_INCLUDE% if "%buildMode%" == "--Debug" ( -robocopy /MIR external\rpclib\rpclib-2.2.1\build\Debug %RPCLIB_TARGET_LIB%\Debug +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Debug %RPCLIB_TARGET_LIB%\Debug ) else if "%buildMode%" == "--Release" ( -robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Release +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Release %RPCLIB_TARGET_LIB%\Release ) else ( -robocopy /MIR external\rpclib\rpclib-2.2.1\build\Debug %RPCLIB_TARGET_LIB%\Debug -robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Release +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Debug %RPCLIB_TARGET_LIB%\Debug +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Release %RPCLIB_TARGET_LIB%\Release ) REM //---------- get High PolyCount SUV Car Model ------------ diff --git a/build.sh b/build.sh index 94aa1b3e6..0eed49d5d 100755 --- a/build.sh +++ b/build.sh @@ -25,7 +25,8 @@ esac done # check for rpclib -if [ ! -d "./external/rpclib/rpclib-2.2.1" ]; then +RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec +if [ ! -d "./external/rpclib/rpclib-${RPC_VERSION}" ]; then echo "ERROR: new version of AirSim requires newer rpclib." echo "please run setup.sh first and then run build.sh again." exit 1 @@ -133,7 +134,7 @@ cp $build_dir/output/lib/librpc.a AirLib/deps/rpclib/lib/librpc.a # Update AirLib/lib, AirLib/deps, Plugins folders with new binaries rsync -a --delete $build_dir/output/lib/ AirLib/lib/x64/Debug -rsync -a --delete external/rpclib/rpclib-2.2.1/include AirLib/deps/rpclib +rsync -a --delete external/rpclib/rpclib-${RPC_VERSION}/include AirLib/deps/rpclib rsync -a --delete MavLinkCom/include AirLib/deps/MavLinkCom rsync -a --delete AirLib Unreal/Plugins/AirSim/Source diff --git a/cmake/cmake-modules/CommonSetup.cmake b/cmake/cmake-modules/CommonSetup.cmake index 5be848353..639985811 100644 --- a/cmake/cmake-modules/CommonSetup.cmake +++ b/cmake/cmake-modules/CommonSetup.cmake @@ -41,7 +41,7 @@ macro(CommonSetup) SET(LIBCXX_LIB_PATH ${AIRSIM_ROOT}/llvm-build/output/lib) #setup include and lib for rpclib which will be referenced by other projects - set(RPCLIB_VERSION_FOLDER rpclib-2.2.1) + set(RPCLIB_VERSION_FOLDER rpclib-c4fb37acbe67ec99e47e5187acd2a7450bde0cec) set(RPC_LIB_INCLUDES " ${AIRSIM_ROOT}/external/rpclib/${RPCLIB_VERSION_FOLDER}/include") #name of .a file with lib prefix set(RPC_LIB rpc) diff --git a/setup.sh b/setup.sh index 123318a95..73cae4ffa 100755 --- a/setup.sh +++ b/setup.sh @@ -136,19 +136,20 @@ else #linux fi # Download rpclib -if [ ! -d "external/rpclib/rpclib-2.2.1" ]; then +RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec +if [ ! -d "external/rpclib/rpclib-${RPC_VERSION}" ]; then echo "*********************************************************************************************" echo "Downloading rpclib..." echo "*********************************************************************************************" - wget https://github.com/rpclib/rpclib/archive/v2.2.1.zip + wget https://github.com/qchateau/rpclib/archive/${RPC_VERSION}.zip -O rpclib.zip # remove previous versions rm -rf "external/rpclib" mkdir -p "external/rpclib" - unzip v2.2.1.zip -d external/rpclib - rm v2.2.1.zip + unzip rpclib.zip -d external/rpclib + rm rpclib.zip fi # Download high-polycount SUV model