JD2022-TU1/main/extern/UbiServices/upstream/build/private/build_ubiservices_internal.command

59 lines
1.6 KiB
Bash

#!/bin/bash
PUBLIC_BUILD_UBISERVICES=TRUE
export PUBLIC_BUILD_UBISERVICES
PLATFORM=$1 # can be: osx, ios, tvos, osx4Unity3d, ios4Unity3d, tvos4Unity3d, linux
SDK_TYPE=$2 # can be: server (or not set)
US_PACKAGE_ROOT=$US_PACKAGE_ROOT
if [ $PLATFORM == linux ]; then
CMAKE_PROXY_PATH=$US_PACKAGE_ROOT/build/private/cmake_proxy_linux.command
else
CMAKE_PROXY_PATH=$US_PACKAGE_ROOT/build/private/cmake_proxy_osx.command
fi
if [ "${SDK_TYPE}" = "server" ]; then SDK_TYPE_FOLDER=SdkServer; SDK_TYPE_EXTENTION=_server
else
SDK_TYPE_FOLDER=SdkClient
fi
############# Generating solution
${US_PACKAGE_ROOT}/build/private/$SDK_TYPE_FOLDER/cmake_generate_$PLATFORM$SDK_TYPE_EXTENTION.command
if [ $? -ne 0 ]; then
echo "The cmake generation returned an error."
exit 2
fi
############# Build
if [ "${PLATFORM}" = "osx4Unity3d" ]; then PLATFORM_FOLDER=osx_shared_U3D;
elif [ "${PLATFORM}" = "ios4Unity3d" ]; then PLATFORM_FOLDER=ios4U3D;
elif [ "${PLATFORM}" = "tvos4Unity3d" ]; then PLATFORM_FOLDER=tvos4U3D;
else PLATFORM_FOLDER=${PLATFORM};
fi
SOLUTION_PATH=$US_PACKAGE_ROOT/_projects/$SDK_TYPE_FOLDER/$PLATFORM_FOLDER
pushd $SOLUTION_PATH
for CONFIG in Debug Profile Release Retail
do
echo "Building target: $CONFIG"
if [ $PLATFORM == linux ]
then
pushd ./$CONFIG
pwd
export PLATFORM
#Setting number of process to 1 to consume less memory on virtual machines.
$CMAKE_PROXY_PATH --build . --config $CONFIG -j 1
popd
else
#ios/tvos/macos
$CMAKE_PROXY_PATH --build . --config $CONFIG -- -sdk $OS_SDK
fi
done
popd