Skip to content

Commit

Permalink
simplify PR: qchateau->madratman; revert commithash->2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
madratman committed Jul 24, 2020
1 parent b842ddc commit b30cf14
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
21 changes: 10 additions & 11 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ if ERRORLEVEL 1 (
)

REM //---------- get rpclib ----------
set RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec
IF NOT EXIST external\rpclib mkdir external\rpclib
IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% (
IF NOT EXIST external\rpclib\rpclib-2.2.1 (
REM //leave some blank lines because powershell shows download banner at top of console
ECHO(
ECHO(
Expand All @@ -57,7 +56,7 @@ IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% (
ECHO Downloading rpclib
ECHO *****************************************************************************************
@echo on
powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/qchateau/rpclib/archive/%RPC_VERSION%.zip -OutFile external\rpclib.zip }"
powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/madratman/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip }"
@echo off

REM //remove any previous versions
Expand All @@ -68,16 +67,16 @@ IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% (

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-%RPC_VERSION% (
IF NOT EXIST external\rpclib\rpclib-2.2.1 (
ECHO Unable to download high-polycount SUV. Your AirSim build will use the default vehicle.
goto :buildfailed
)
)

REM //---------- Build rpclib ------------
ECHO Starting cmake to build rpclib...
IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION%\build mkdir external\rpclib\rpclib-%RPC_VERSION%\build
cd external\rpclib\rpclib-%RPC_VERSION%\build
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
REM cmake -G"Visual Studio 14 2015 Win64" ..
cmake -G"Visual Studio 16 2019" ..

Expand All @@ -98,15 +97,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-%RPC_VERSION%\include %RPCLIB_TARGET_INCLUDE%
robocopy /MIR external\rpclib\rpclib-2.2.1\include %RPCLIB_TARGET_INCLUDE%

if "%buildMode%" == "--Debug" (
robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Debug %RPCLIB_TARGET_LIB%\Debug
robocopy /MIR external\rpclib\rpclib-2.2.1\build\Debug %RPCLIB_TARGET_LIB%\Debug
) else if "%buildMode%" == "--Release" (
robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Release %RPCLIB_TARGET_LIB%\Release
robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Release
) else (
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
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
)

REM //---------- get High PolyCount SUV Car Model ------------
Expand Down
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ set -x
function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; }

# check for rpclib
RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec
if [ ! -d "./external/rpclib/rpclib-${RPC_VERSION}" ]; then
if [ ! -d "./external/rpclib/rpclib-2.2.1" ]; then
echo "ERROR: new version of AirSim requires newer rpclib."
echo "please run setup.sh first and then run build.sh again."
exit 1
Expand Down Expand Up @@ -79,7 +78,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-${RPC_VERSION}/include AirLib/deps/rpclib
rsync -a --delete external/rpclib/rpclib-2.2.1/include AirLib/deps/rpclib
rsync -a --delete MavLinkCom/include AirLib/deps/MavLinkCom
rsync -a --delete AirLib Unreal/Plugins/AirSim/Source

Expand Down
2 changes: 1 addition & 1 deletion cmake/cmake-modules/CommonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ macro(CommonSetup)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

#setup include and lib for rpclib which will be referenced by other projects
set(RPCLIB_VERSION_FOLDER rpclib-c4fb37acbe67ec99e47e5187acd2a7450bde0cec)
set(RPCLIB_VERSION_FOLDER rpclib-2.2.1)
set(RPC_LIB_INCLUDES " ${AIRSIM_ROOT}/external/rpclib/${RPCLIB_VERSION_FOLDER}/include")
#name of .a file with lib prefix
set(RPC_LIB rpc)
Expand Down
5 changes: 2 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,12 @@ fi # End USB setup, CMake install


# Download rpclib
RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec
if [ ! -d "external/rpclib/rpclib-${RPC_VERSION}" ]; then
if [ ! -d "external/rpclib/rpclib-2.2.1" ]; then
echo "*********************************************************************************************"
echo "Downloading rpclib..."
echo "*********************************************************************************************"

wget https://github.com/qchateau/rpclib/archive/${RPC_VERSION}.zip -O rpclib.zip
wget https://github.com/madratman/rpclib/archive/v2.2.1.zip

# remove previous versions
rm -rf "external/rpclib"
Expand Down

0 comments on commit b30cf14

Please sign in to comment.