Skip to content

Commit

Permalink
Fix Unity build.sh
Browse files Browse the repository at this point in the history
Fix CMake detection, non-standard string comparision, remove whitespace, spurious semicolons
Add debug info
  • Loading branch information
rajat2004 committed Jan 6, 2020
1 parent c77396c commit 00e13e6
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions Unity/build.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
#! /bin/bash

set -x

# check for rpclib
if [ ! -f ../external/rpclib/rpclib-2.2.1/rpclib.pc.in ]; then
>&2 echo "error, rpc.pc.in not found"
>&2 echo "error, rpc.pc.in not found, please run setup.sh first and then run build.sh again"
fi

cp ../external/rpclib/rpclib-2.2.1/rpclib.pc.in AirLibWrapper/AirsimWrapper/rpclib.pc.in

if [ ! -d "linux-build" ]; then
mkdir linux-build;
mkdir linux-build
fi


cd linux-build;
cd linux-build
export CC="clang-5.0"
export CXX="clang++-5.0"

if [ "$(uname)" == "Darwin" ]; then
CMAKE="$(greadlink -f ../../cmake_build/bin/cmake)"
# check for local cmake build created by setup.sh
if [ -d "../../cmake_build" ]; then
if [ "$(uname)" = "Darwin" ]; then
CMAKE="$(greadlink -f ../../cmake_build/bin/cmake)"
else
CMAKE="$(readlink -f ../../cmake_build/bin/cmake)"
fi
else
CMAKE="$(readlink -f ../../cmake_build/bin/cmake)"
CMAKE=$(which cmake)
fi

"$CMAKE" ../../cmake ../AirLibWrapper/AirsimWrapper;
make -j`nproc`;
"$CMAKE" ../../cmake ../AirLibWrapper/AirsimWrapper
make -j`nproc`
if [ ! -d "../UnityDemo/Assets/Plugins" ]; then
mkdir ../ UnityDemo/Assets/Plugins;
mkdir ../UnityDemo/Assets/Plugins
fi

if [ "$(uname)" == "Darwin" ]; then
cp AirsimWrapper.bundle ../UnityDemo/Assets/Plugins;
if [ "$(uname)" = "Darwin" ]; then
cp AirsimWrapper.bundle ../UnityDemo/Assets/Plugins
else
cp libAirsimWrapper.so ../UnityDemo/Assets/Plugins;
cp libAirsimWrapper.so ../UnityDemo/Assets/Plugins
fi

cd ..
if [ -f AirLibWrapper/AirsimWrapper/rpclib.pc.in ]; then
rm AirLibWrapper/AirsimWrapper/rpclib.pc.in
rm AirLibWrapper/AirsimWrapper/rpclib.pc.in
fi

0 comments on commit 00e13e6

Please sign in to comment.