Files
UnrealEngineUWP/Engine/Source/ThirdParty/CMake/PlatformScripts/TVOS/BuildLibForTVOS.command
devin doucette 0d0880c989 Extended and added platforms to UAT BuildCMakeLib
- Wrapped the build in try/finally to always clean up of the build directory.
- Fixed target platform construction to include the target architecture.
- Fixed target platform construction to log an error on failure instead of crashing on a null dereference later.
- Fixed configuration name comparisons to be case-insensitive.
- Added an optional BinOutputPath param to match LibOutputPath.
- Changed to an empty default MakeTarget because CMake was not generating a target with the previous default name.
- Changed BuildTargetLib to use cmake --build instead of implementing custom build logic for every target platform.
- Changed Linux to use CMake and make from the path instead of attempting to use the Mac binaries.
- Simplified the TargetPlatform interface to remove a lot of boilerplate code from the implementations.

#jira none
#rb Brandon.Schaefer

[CL 14439522 by devin doucette in ue5-main branch]
2020-10-07 13:32:27 -04:00

23 lines
1.1 KiB
Bash
Executable File

#!/bin/zsh -e
# Copyright Epic Games, Inc. All Rights Reserved.
# Usage: BuildLibForTVOS.command <LibName> <LibVersion> [Configs] [Archs] [DeploymentTarget]
LIB_NAME=${1:?Missing library name argument}
LIB_VERSION=${2:?Missing library version argument}
LIB_CONFIGS=(${=3:-Debug Release})
LIB_ARCHS=(${=4:-arm64 x86_64})
LIB_DEPLOYMENT_TARGET=${5:-11.0}
LIB_DIR=${0:a:h:h:h:h}/${LIB_NAME}/${LIB_VERSION}/lib/TVOS
ENGINE_ROOT=${0:a:h:h:h:h:h:h}
for Config in ${LIB_CONFIGS}; do
for Arch in ${LIB_ARCHS}; do
echo "Building ${LIB_NAME}-${LIB_VERSION} for tvOS ${Arch} in ${Config}..."
${ENGINE_ROOT}/Build/BatchFiles/RunUAT.command BuildCMakeLib -TargetPlatform=TVOS -TargetArchitecture=${Arch} -TargetLib=${LIB_NAME} -TargetLibVersion=${LIB_VERSION} -TargetConfigs=${Config} -LibOutputPath=lib -CMakeGenerator=Makefile -CMakeAdditionalArguments="-DCMAKE_OSX_DEPLOYMENT_TARGET=${LIB_DEPLOYMENT_TARGET}" -SkipCreateChangelist
done
mkdir -p ${LIB_DIR}/${Config}
lipo -create -output ${LIB_DIR}/${Config}/lib${LIB_NAME}.a ${LIB_DIR}/${^LIB_ARCHS}/${Config}/lib${LIB_NAME}.a
rm -rf ${LIB_DIR}/${^LIB_ARCHS}
done