Files
UnrealEngineUWP/Engine/Source/ThirdParty/ShaderConductor/Build_ShaderConductor_Mac.command
will damon 1c4c73bd3b Script changes required to enable building ShaderConductor as a Universal binary for macOS
- Add universal_mac target
- Remove dead core2 architecture flag

#rb laura.hermanns
#jira UE-145025
#rnx
#preflight n/a

[CL 19785353 by will damon in ue5-main branch]
2022-04-18 10:43:34 -04:00

62 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
PATH="/Applications/CMake.app/Contents/bin":"$PATH"
CUR_DIR=`pwd`
cd $CUR_DIR
if [ ! -d ninja ]; then
git clone https://github.com/ninja-build/ninja.git && cd ninja
git checkout release
./configure.py --bootstrap
cd ..
fi
PATH="$CUR_DIR/ninja":"$PATH"
export PATH
export MACOSX_DEPLOYMENT_TARGET=10.14
cd ShaderConductor
# p4 edit $THIRD_PARTY_CHANGELIST lib/Mac/...
# Compile for Mac
SRC_DIR="Build"
DST_DIR="../../../../Binaries/ThirdParty/ShaderConductor/Mac"
if [ "$#" -eq 1 ] && [ "$1" == "-debug" ]; then
# Debug
if [ "$BUILD_UNIVERSAL" = true ] ; then
python3 BuildAll.py ninja clang mac_universal Debug
SRC_DIR="$SRC_DIR/ninja-osx-clang-mac_universal-Debug"
else
python3 BuildAll.py ninja clang x64 Debug
SRC_DIR="$SRC_DIR/ninja-osx-clang-x64-Debug"
fi
else
# Release
if [ "$BUILD_UNIVERSAL" = true ] ; then
python3 BuildAll.py ninja clang mac_universal RelWithDebInfo
SRC_DIR="$SRC_DIR/ninja-osx-clang-mac_universal-RelWithDebInfo"
else
python3 BuildAll.py ninja clang x64 RelWithDebInfo
SRC_DIR="$SRC_DIR/ninja-osx-clang-x64-RelWithDebInfo"
fi
fi
# Copy binary files from source to destination
cp -f "$SRC_DIR/Lib/libdxcompiler.dylib" "$DST_DIR/libdxcompiler.dylib"
cp -f "$SRC_DIR/Lib/libShaderConductor.dylib" "$DST_DIR/libShaderConductor.dylib"
cp -f "$SRC_DIR/Bin/ShaderConductorCmd" "$DST_DIR/ShaderConductorCmd"
# Replace dummy RPATH value, so ShaderConductor can manually load libdxcompiler.dylib via the 'dlopen' API
install_name_tool -rpath RPATH_DUMMY ../ThirdParty/ShaderConductor/Mac "$DST_DIR/libShaderConductor.dylib"
install_name_tool -rpath RPATH_DUMMY ../ThirdParty/ShaderConductor/Mac "$DST_DIR/libdxcompiler.dylib"
# Link DWARF debug symbols
dsymutil "$DST_DIR/libdxcompiler.dylib"
dsymutil "$DST_DIR/libShaderConductor.dylib"