Files

67 lines
2.4 KiB
Bash
Raw Permalink Normal View History

2020-04-06 19:53:23 -07:00
#!/bin/sh -ex
2018-07-15 18:12:43 -07:00
2025-06-08 16:33:45 +02:00
cd rpcs3 || exit 1
2018-07-15 18:12:43 -07:00
2025-04-29 21:39:50 +02:00
shellcheck .ci/*.sh
2023-08-30 10:09:23 -07:00
git config --global --add safe.directory '*'
2025-06-13 02:05:15 +02:00
# Pull all the submodules except some
2020-04-06 19:53:23 -07:00
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
2025-06-13 02:05:15 +02:00
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/libsdl-org/ && !/curl/ && !/zlib/ { print $3 }' .gitmodules)
2018-07-15 18:12:43 -07:00
2020-04-06 19:53:23 -07:00
mkdir build && cd build || exit 1
2018-07-15 18:12:43 -07:00
2020-04-06 19:53:23 -07:00
if [ "$COMPILER" = "gcc" ]; then
2020-04-08 21:33:38 -07:00
# These are set in the dockerfile
2022-07-16 12:10:50 -07:00
export CC="${GCC_BINARY}"
export CXX="${GXX_BINARY}"
2020-04-08 21:33:38 -07:00
export LINKER=gold
# We need to set the following variables for LTO to link properly
2022-07-16 12:10:50 -07:00
export AR=/usr/bin/gcc-ar-"$GCCVER"
export RANLIB=/usr/bin/gcc-ranlib-"$GCCVER"
2020-04-08 21:33:38 -07:00
export CFLAGS="-fuse-linker-plugin"
2018-07-15 18:12:43 -07:00
else
2022-07-16 12:10:50 -07:00
export CC="${CLANG_BINARY}"
export CXX="${CLANGXX_BINARY}"
2020-04-08 21:33:38 -07:00
export LINKER=lld
2022-07-16 12:10:50 -07:00
export AR=/usr/bin/llvm-ar-"$LLVMVER"
export RANLIB=/usr/bin/llvm-ranlib-"$LLVMVER"
2018-07-15 18:12:43 -07:00
fi
2025-04-26 20:17:16 +02:00
export LINKER_FLAG="-fuse-ld=${LINKER}"
2020-04-08 21:33:38 -07:00
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_PRECOMPILED_HEADERS=OFF \
2020-04-08 21:33:38 -07:00
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CFLAGS" \
2025-04-26 20:17:16 +02:00
-DCMAKE_EXE_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_MODULE_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_SHARED_LINKER_FLAGS="${LINKER_FLAG}" \
2020-04-08 21:33:38 -07:00
-DCMAKE_AR="$AR" \
-DCMAKE_RANLIB="$RANLIB" \
2020-10-28 23:44:21 +00:00
-DUSE_SYSTEM_CURL=ON \
2023-05-05 18:39:27 +02:00
-DUSE_SDL=ON \
-DUSE_SYSTEM_SDL=ON \
2026-04-05 11:24:38 +02:00
-DUSE_SYSTEM_FFMPEG=ON \
2024-11-16 11:03:42 +01:00
-DUSE_SYSTEM_OPENCV=ON \
2024-01-25 06:16:02 +01:00
-DUSE_DISCORD_RPC=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
2023-04-29 10:59:16 -07:00
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
-DSTATIC_LINK_LLVM=ON \
2025-05-01 12:57:46 +02:00
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
2020-04-08 21:33:38 -07:00
-G Ninja
2018-07-15 18:12:43 -07:00
2019-04-05 20:17:54 -07:00
ninja; build_status=$?;
2018-07-15 18:12:43 -07:00
cd ..
2021-04-04 11:34:12 +03:00
# If it compiled succesfully let's deploy.
2025-06-08 16:33:45 +02:00
if [ "$build_status" -eq 0 ]; then
.ci/deploy-linux.sh "x86_64"
fi