rpcsx/.ci/build-linux.sh

52 lines
1.8 KiB
Bash
Raw Normal View History

#!/bin/sh -ex
2018-07-16 03:12:43 +02:00
2023-08-30 19:09:23 +02:00
git config --global --add safe.directory '*'
# Pull all the submodules except llvm and opencv
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ { print $3 }' .gitmodules)
2018-07-16 03:12:43 +02:00
if [ "$COMPILER" = "gcc" ]; then
2020-04-09 06:33:38 +02:00
# These are set in the dockerfile
export CC=gcc-14
export CXX=g++-14
2018-07-16 03:12:43 +02:00
else
export CC=clang
export CXX=clang++
export LD=clang
export CFLAGS="$CFLAGS -fuse-ld=lld"
2018-07-16 03:12:43 +02:00
fi
2025-04-07 16:24:10 +02:00
cmake -B build \
2020-04-09 06:33:38 +02:00
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CFLAGS" \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DUSE_SDL=OFF \
-DUSE_SYSTEM_CURL=OFF \
-DUSE_SYSTEM_OPENAL=OFF \
2023-05-16 20:24:55 +02:00
-DUSE_SYSTEM_FFMPEG=OFF \
2024-01-25 06:16:02 +01:00
-DUSE_DISCORD_RPC=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
2023-04-29 19:59:16 +02:00
-DSTATIC_LINK_LLVM=ON \
-DBUILD_LLVM=on \
2025-04-07 16:24:10 +02:00
-DWITH_RPCSX=off \
-DWITH_RPCS3=on \
-DWITH_RPCS3_QT_UI=on \
2020-04-09 06:33:38 +02:00
-G Ninja
2018-07-16 03:12:43 +02:00
2025-04-07 16:24:10 +02:00
cmake --build build; build_status=$?;
2025-04-07 16:24:10 +02:00
shellcheck .ci/*.sh
2021-04-04 10:34:12 +02:00
# If it compiled succesfully let's deploy.
# Azure and Cirrus publish PRs as artifacts only.
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
2025-04-07 16:24:10 +02:00
.ci/deploy-linux.sh "x86_64"
fi