2020-04-07 02:53:23 +00:00
|
|
|
#!/bin/sh -ex
|
2018-07-16 01:12:43 +00:00
|
|
|
|
|
|
|
# Setup Qt variables
|
2022-07-16 19:10:50 +00:00
|
|
|
export QT_BASE_DIR=/opt/qt"${QTVERMIN}"
|
|
|
|
export PATH="$QT_BASE_DIR"/bin:"$PATH"
|
|
|
|
export LD_LIBRARY_PATH="$QT_BASE_DIR"/lib/x86_64-linux-gnu:"$QT_BASE_DIR"/lib
|
2018-07-16 01:12:43 +00:00
|
|
|
|
2021-04-04 08:34:12 +00:00
|
|
|
if [ -z "$CIRRUS_CI" ]; then
|
|
|
|
cd rpcs3 || exit 1
|
|
|
|
fi
|
2018-07-16 01:12:43 +00:00
|
|
|
|
2020-04-07 02:53:23 +00:00
|
|
|
# Pull all the submodules except llvm, since it is built separately and we just download that build
|
|
|
|
# Note: Tried to use git submodule status, but it takes over 20 seconds
|
|
|
|
# shellcheck disable=SC2046
|
|
|
|
git submodule -q update --init $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
|
2018-07-16 01:12:43 +00:00
|
|
|
|
|
|
|
# Download pre-compiled llvm libs
|
2020-02-24 17:39:39 +00:00
|
|
|
curl -sLO https://github.com/RPCS3/llvm-mirror/releases/download/custom-build/llvmlibs-linux.tar.gz
|
2018-07-16 01:12:43 +00:00
|
|
|
mkdir llvmlibs
|
|
|
|
tar -xzf ./llvmlibs-linux.tar.gz -C llvmlibs
|
|
|
|
|
2020-04-07 02:53:23 +00:00
|
|
|
mkdir build && cd build || exit 1
|
2018-07-16 01:12:43 +00:00
|
|
|
|
2020-04-07 02:53:23 +00:00
|
|
|
if [ "$COMPILER" = "gcc" ]; then
|
2020-04-09 04:33:38 +00:00
|
|
|
# These are set in the dockerfile
|
2022-07-16 19:10:50 +00:00
|
|
|
export CC="${GCC_BINARY}"
|
|
|
|
export CXX="${GXX_BINARY}"
|
2020-04-09 04:33:38 +00:00
|
|
|
export LINKER=gold
|
|
|
|
# We need to set the following variables for LTO to link properly
|
2022-07-16 19:10:50 +00:00
|
|
|
export AR=/usr/bin/gcc-ar-"$GCCVER"
|
|
|
|
export RANLIB=/usr/bin/gcc-ranlib-"$GCCVER"
|
2020-04-09 04:33:38 +00:00
|
|
|
export CFLAGS="-fuse-linker-plugin"
|
2018-07-16 01:12:43 +00:00
|
|
|
else
|
2022-07-16 19:10:50 +00:00
|
|
|
export CC="${CLANG_BINARY}"
|
|
|
|
export CXX="${CLANGXX_BINARY}"
|
2020-04-09 04:33:38 +00:00
|
|
|
export LINKER=lld
|
2022-07-16 19:10:50 +00:00
|
|
|
export AR=/usr/bin/llvm-ar-"$LLVMVER"
|
|
|
|
export RANLIB=/usr/bin/llvm-ranlib-"$LLVMVER"
|
2018-07-16 01:12:43 +00:00
|
|
|
fi
|
|
|
|
|
2020-03-19 07:49:40 +00:00
|
|
|
export CFLAGS="$CFLAGS -fuse-ld=${LINKER}"
|
2020-03-17 05:54:47 +00:00
|
|
|
|
2020-04-09 04:33:38 +00:00
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2020-02-20 07:53:10 +00:00
|
|
|
-DBUILD_LLVM_SUBMODULE=OFF \
|
2020-04-09 04:33:38 +00:00
|
|
|
-DLLVM_DIR=llvmlibs/lib/cmake/llvm/ \
|
|
|
|
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
2020-02-20 07:53:10 +00:00
|
|
|
-DUSE_PRECOMPILED_HEADERS=OFF \
|
2020-04-09 04:33:38 +00:00
|
|
|
-DCMAKE_C_FLAGS="$CFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS="$CFLAGS" \
|
|
|
|
-DCMAKE_AR="$AR" \
|
|
|
|
-DCMAKE_RANLIB="$RANLIB" \
|
2020-10-28 23:44:21 +00:00
|
|
|
-DUSE_SYSTEM_CURL=ON \
|
2022-10-15 19:01:38 +00:00
|
|
|
-DUSE_SDL=OFF \
|
2021-05-07 02:14:31 +00:00
|
|
|
-DOpenGL_GL_PREFERENCE=LEGACY \
|
2020-04-09 04:33:38 +00:00
|
|
|
-G Ninja
|
2018-07-16 01:12:43 +00:00
|
|
|
|
2019-04-06 03:17:54 +00:00
|
|
|
ninja; build_status=$?;
|
2018-07-16 01:12:43 +00:00
|
|
|
|
|
|
|
cd ..
|
2020-03-03 02:42:28 +00:00
|
|
|
|
2021-03-20 06:11:37 +00:00
|
|
|
shellcheck .ci/*.sh
|
|
|
|
|
2021-04-04 08:34:12 +00:00
|
|
|
# If it compiled succesfully let's deploy.
|
|
|
|
# Azure and Cirrus publish PRs as artifacts only.
|
|
|
|
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
|
2020-04-07 02:53:23 +00:00
|
|
|
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
|
|
|
|
|
|
|
|
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
|
2020-04-09 04:33:38 +00:00
|
|
|
.ci/deploy-linux.sh
|
2020-03-03 02:42:28 +00:00
|
|
|
fi
|