mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 13:01:27 +12:00
CI: build windows clang
This commit is contained in:
parent
9634e58f0a
commit
d0812ee5a8
20 changed files with 341 additions and 106 deletions
|
@ -1,8 +1,6 @@
|
||||||
#!/bin/sh -ex
|
#!/bin/sh -ex
|
||||||
|
|
||||||
if [ -z "$CIRRUS_CI" ]; then
|
cd rpcs3 || exit 1
|
||||||
cd rpcs3 || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
shellcheck .ci/*.sh
|
shellcheck .ci/*.sh
|
||||||
|
|
||||||
|
@ -52,10 +50,6 @@ ninja; build_status=$?;
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# If it compiled succesfully let's deploy.
|
# If it compiled succesfully let's deploy.
|
||||||
# Azure and Cirrus publish PRs as artifacts only.
|
if [ "$build_status" -eq 0 ]; then
|
||||||
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
|
|
||||||
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
|
|
||||||
|
|
||||||
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
|
|
||||||
.ci/deploy-linux.sh "aarch64"
|
.ci/deploy-linux.sh "aarch64"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#!/bin/sh -ex
|
#!/bin/sh -ex
|
||||||
|
|
||||||
if [ -z "$CIRRUS_CI" ]; then
|
cd rpcs3 || exit 1
|
||||||
cd rpcs3 || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
shellcheck .ci/*.sh
|
shellcheck .ci/*.sh
|
||||||
|
|
||||||
|
@ -63,10 +61,6 @@ ninja; build_status=$?;
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# If it compiled succesfully let's deploy.
|
# If it compiled succesfully let's deploy.
|
||||||
# Azure and Cirrus publish PRs as artifacts only.
|
if [ "$build_status" -eq 0 ]; then
|
||||||
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
|
|
||||||
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
|
|
||||||
|
|
||||||
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
|
|
||||||
.ci/deploy-linux.sh "x86_64"
|
.ci/deploy-linux.sh "x86_64"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -115,9 +115,7 @@ export MACOSX_DEPLOYMENT_TARGET=14.0
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
|
# If it compiled succesfully let's deploy.
|
||||||
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
|
if [ "$build_status" -eq 0 ]; then
|
||||||
|
|
||||||
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
|
|
||||||
.ci/deploy-mac-arm64.sh
|
.ci/deploy-mac-arm64.sh
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -118,9 +118,7 @@ export MACOSX_DEPLOYMENT_TARGET=14.0
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
|
# If it compiled succesfully let's deploy.
|
||||||
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
|
if [ "$build_status" -eq 0 ]; then
|
||||||
|
|
||||||
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
|
|
||||||
.ci/deploy-mac.sh
|
.ci/deploy-mac.sh
|
||||||
fi
|
fi
|
||||||
|
|
59
.ci/build-windows-clang.sh
Normal file
59
.ci/build-windows-clang.sh
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
#!/bin/sh -ex
|
||||||
|
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
|
# Pull all the submodules except some
|
||||||
|
# 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/ && !/ffmpeg/ && !/curl/ && !/FAudio/ { print $3 }' .gitmodules)
|
||||||
|
|
||||||
|
mkdir build && cd build || exit 1
|
||||||
|
|
||||||
|
export CC="clang"
|
||||||
|
export CXX="clang++"
|
||||||
|
export LINKER=lld
|
||||||
|
export LINKER_FLAG="-fuse-ld=${LINKER}"
|
||||||
|
|
||||||
|
if [ -n "$LLVMVER" ]; then
|
||||||
|
export AR="llvm-ar-$LLVMVER"
|
||||||
|
export RANLIB="llvm-ranlib-$LLVMVER"
|
||||||
|
else
|
||||||
|
export AR="llvm-ar"
|
||||||
|
export RANLIB="llvm-ranlib"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cmake .. \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
||||||
|
-DUSE_PRECOMPILED_HEADERS=OFF \
|
||||||
|
-DCMAKE_C_FLAGS="$CFLAGS" \
|
||||||
|
-DCMAKE_CXX_FLAGS="$CFLAGS" \
|
||||||
|
-DCMAKE_EXE_LINKER_FLAGS="${LINKER_FLAG}" \
|
||||||
|
-DCMAKE_MODULE_LINKER_FLAGS="${LINKER_FLAG}" \
|
||||||
|
-DCMAKE_SHARED_LINKER_FLAGS="${LINKER_FLAG}" \
|
||||||
|
-DCMAKE_AR="$AR" \
|
||||||
|
-DCMAKE_RANLIB="$RANLIB" \
|
||||||
|
-DUSE_SYSTEM_CURL=ON \
|
||||||
|
-DUSE_FAUDIO=OFF \
|
||||||
|
-DUSE_SDL=ON \
|
||||||
|
-DUSE_SYSTEM_SDL=OFF \
|
||||||
|
-DUSE_SYSTEM_FFMPEG=ON \
|
||||||
|
-DUSE_SYSTEM_OPENCV=ON \
|
||||||
|
-DUSE_SYSTEM_OPENAL=OFF \
|
||||||
|
-DUSE_DISCORD_RPC=ON \
|
||||||
|
-DOpenGL_GL_PREFERENCE=LEGACY \
|
||||||
|
-DWITH_LLVM=ON \
|
||||||
|
-DLLVM_DIR=/clang64/lib/cmake/llvm \
|
||||||
|
-DSTATIC_LINK_LLVM=ON \
|
||||||
|
-DBUILD_RPCS3_TESTS=OFF \
|
||||||
|
-DRUN_RPCS3_TESTS=OFF \
|
||||||
|
-G Ninja
|
||||||
|
|
||||||
|
ninja; build_status=$?;
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# If it compiled succesfully let's deploy.
|
||||||
|
if [ "$build_status" -eq 0 ]; then
|
||||||
|
.ci/deploy-windows-clang.sh "x86_64"
|
||||||
|
fi
|
38
.ci/deploy-windows-clang.sh
Normal file
38
.ci/deploy-windows-clang.sh
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/bin/sh -ex
|
||||||
|
|
||||||
|
# source ci-vars.env
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
. .ci/ci-vars.env
|
||||||
|
|
||||||
|
cd build || exit 1
|
||||||
|
|
||||||
|
CPU_ARCH="${1:-x86_64}"
|
||||||
|
|
||||||
|
echo "Deploying rpcs3 windows clang $CPU_ARCH"
|
||||||
|
|
||||||
|
# BUILD_blablabla is CI specific, so we wrap it for portability
|
||||||
|
ARTIFACT_DIR=$(cygpath -u "$BUILD_ARTIFACTSTAGINGDIRECTORY")
|
||||||
|
MSYS2_CLANG_BIN=$(cygpath -w /clang64/bin)
|
||||||
|
MSYS2_USR_BIN=$(cygpath -w /usr/bin)
|
||||||
|
|
||||||
|
echo "Installing dependencies of: ./bin/rpcs3.exe (MSYS2 dir is '$MSYS2_CLANG_BIN', usr dir is '$MSYS2_USR_BIN')"
|
||||||
|
cmake -DMSYS2_CLANG_BIN="$MSYS2_CLANG_BIN" -DMSYS2_USR_BIN="$MSYS2_USR_BIN" -Dexe=./bin/rpcs3.exe -P ../buildfiles/cmake/CopyRuntimeDependencies.cmake
|
||||||
|
|
||||||
|
# Prepare compatibility and SDL database for packaging
|
||||||
|
mkdir ./bin/config
|
||||||
|
mkdir ./bin/config/input_configs
|
||||||
|
curl -fsSL 'https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt' 1> ./bin/config/input_configs/gamecontrollerdb.txt
|
||||||
|
curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 1> ./bin/GuiConfigs/compat_database.dat
|
||||||
|
|
||||||
|
# Package artifacts
|
||||||
|
7z a -m0=LZMA2 -mx9 "$BUILD" ./bin/*
|
||||||
|
|
||||||
|
# Generate sha256 hashes
|
||||||
|
# Write to file for GitHub releases
|
||||||
|
sha256sum "$BUILD" | awk '{ print $1 }' | tee "$BUILD.sha256"
|
||||||
|
echo "$(cat "$BUILD.sha256");$(stat -c %s "$BUILD")B" > GitHubReleaseMessage.txt
|
||||||
|
|
||||||
|
# Move files to publishing directory
|
||||||
|
mkdir -p "$ARTIFACT_DIR"
|
||||||
|
cp -- "$BUILD" "$ARTIFACT_DIR"
|
||||||
|
cp -- "$BUILD.sha256" "$ARTIFACT_DIR"
|
|
@ -3,7 +3,7 @@
|
||||||
# First let's print some info about our caches
|
# First let's print some info about our caches
|
||||||
"$(cygpath -u "$CCACHE_BIN_DIR")"/ccache.exe --show-stats -v
|
"$(cygpath -u "$CCACHE_BIN_DIR")"/ccache.exe --show-stats -v
|
||||||
|
|
||||||
# BUILD_blablabla is Azure specific, so we wrap it for portability
|
# BUILD_blablabla is CI specific, so we wrap it for portability
|
||||||
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
|
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
|
||||||
|
|
||||||
# Remove unecessary files
|
# Remove unecessary files
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
# Variables set by Azure Pipelines
|
# Variables set by CI
|
||||||
CI_HAS_ARTIFACTS
|
|
||||||
BUILD_REASON
|
BUILD_REASON
|
||||||
BUILD_SOURCEVERSION
|
BUILD_SOURCEVERSION
|
||||||
BUILD_ARTIFACTSTAGINGDIRECTORY
|
BUILD_ARTIFACTSTAGINGDIRECTORY
|
||||||
|
|
39
.ci/setup-windows-ci-vars.sh
Normal file
39
.ci/setup-windows-ci-vars.sh
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/sh -ex
|
||||||
|
|
||||||
|
CPU_ARCH="${1:-win64}"
|
||||||
|
COMPILER="${2:-msvc}"
|
||||||
|
|
||||||
|
# These are CI specific, so we wrap them for portability
|
||||||
|
REPO_NAME="$BUILD_REPOSITORY_NAME"
|
||||||
|
REPO_BRANCH="$BUILD_SOURCEBRANCHNAME"
|
||||||
|
PR_NUMBER="$BUILD_PR_NUMBER"
|
||||||
|
|
||||||
|
# Gather explicit version number and number of commits
|
||||||
|
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
|
||||||
|
COMM_COUNT=$(git rev-list --count HEAD)
|
||||||
|
COMM_HASH=$(git rev-parse --short=8 HEAD)
|
||||||
|
|
||||||
|
# Format the above into filenames
|
||||||
|
if [ -n "$PR_NUMBER" ]; then
|
||||||
|
AVVER="${COMM_TAG}-${COMM_HASH}"
|
||||||
|
BUILD_RAW="rpcs3-v${AVVER}_${CPU_ARCH}_${COMPILER}"
|
||||||
|
BUILD="${BUILD_RAW}.7z"
|
||||||
|
else
|
||||||
|
AVVER="${COMM_TAG}-${COMM_COUNT}"
|
||||||
|
BUILD_RAW="rpcs3-v${AVVER}-${COMM_HASH}_${CPU_ARCH}_${COMPILER}"
|
||||||
|
BUILD="${BUILD_RAW}.7z"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# BRANCH is used for experimental build warnings for pr builds, used in main_window.cpp.
|
||||||
|
# BUILD is the name of the release artifact
|
||||||
|
# BUILD_RAW is just filename
|
||||||
|
# AVVER is used for GitHub releases, it is the version number.
|
||||||
|
BRANCH="${REPO_NAME}/${REPO_BRANCH}"
|
||||||
|
|
||||||
|
# SC2129
|
||||||
|
{
|
||||||
|
echo "BRANCH=$BRANCH"
|
||||||
|
echo "BUILD=$BUILD"
|
||||||
|
echo "BUILD_RAW=$BUILD_RAW"
|
||||||
|
echo "AVVER=$AVVER"
|
||||||
|
} >> .ci/ci-vars.env
|
|
@ -1,10 +1,5 @@
|
||||||
#!/bin/sh -ex
|
#!/bin/sh -ex
|
||||||
|
|
||||||
# These are Azure specific, so we wrap them for portability
|
|
||||||
REPO_NAME="$BUILD_REPOSITORY_NAME"
|
|
||||||
REPO_BRANCH="$BUILD_SOURCEBRANCHNAME"
|
|
||||||
PR_NUMBER="$BUILD_PR_NUMBER"
|
|
||||||
|
|
||||||
# Resource/dependency URLs
|
# Resource/dependency URLs
|
||||||
# Qt mirrors can be volatile and slow, so we list 2
|
# Qt mirrors can be volatile and slow, so we list 2
|
||||||
#QT_HOST="http://mirrors.ocf.berkeley.edu/qt/"
|
#QT_HOST="http://mirrors.ocf.berkeley.edu/qt/"
|
||||||
|
@ -33,7 +28,7 @@ DEP_URLS=" \
|
||||||
$VULKAN_SDK_URL\
|
$VULKAN_SDK_URL\
|
||||||
$CCACHE_URL"
|
$CCACHE_URL"
|
||||||
|
|
||||||
# Azure pipelines doesn't make a cache dir if it doesn't exist, so we do it manually
|
# CI doesn't make a cache dir if it doesn't exist, so we do it manually
|
||||||
[ -d "$DEPS_CACHE_DIR" ] || mkdir "$DEPS_CACHE_DIR"
|
[ -d "$DEPS_CACHE_DIR" ] || mkdir "$DEPS_CACHE_DIR"
|
||||||
|
|
||||||
# Pull all the submodules except llvm, since it is built separately and we just download that build
|
# Pull all the submodules except llvm, since it is built separately and we just download that build
|
||||||
|
@ -99,33 +94,3 @@ done
|
||||||
CCACHE_SH_DIR=$(cygpath -u "$CCACHE_BIN_DIR")
|
CCACHE_SH_DIR=$(cygpath -u "$CCACHE_BIN_DIR")
|
||||||
mv "$CCACHE_SH_DIR"/ccache-*/* "$CCACHE_SH_DIR"
|
mv "$CCACHE_SH_DIR"/ccache-*/* "$CCACHE_SH_DIR"
|
||||||
cp "$CCACHE_SH_DIR"/ccache.exe "$CCACHE_SH_DIR"/cl.exe
|
cp "$CCACHE_SH_DIR"/ccache.exe "$CCACHE_SH_DIR"/cl.exe
|
||||||
|
|
||||||
# Gather explicit version number and number of commits
|
|
||||||
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
|
|
||||||
COMM_COUNT=$(git rev-list --count HEAD)
|
|
||||||
COMM_HASH=$(git rev-parse --short=8 HEAD)
|
|
||||||
|
|
||||||
# Format the above into filenames
|
|
||||||
if [ -n "$PR_NUMBER" ]; then
|
|
||||||
AVVER="${COMM_TAG}-${COMM_HASH}"
|
|
||||||
BUILD_RAW="rpcs3-v${AVVER}_win64"
|
|
||||||
BUILD="${BUILD_RAW}.7z"
|
|
||||||
else
|
|
||||||
AVVER="${COMM_TAG}-${COMM_COUNT}"
|
|
||||||
BUILD_RAW="rpcs3-v${AVVER}-${COMM_HASH}_win64"
|
|
||||||
BUILD="${BUILD_RAW}.7z"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# BRANCH is used for experimental build warnings for pr builds, used in main_window.cpp.
|
|
||||||
# BUILD is the name of the release artifact
|
|
||||||
# BUILD_RAW is just filename
|
|
||||||
# AVVER is used for GitHub releases, it is the version number.
|
|
||||||
BRANCH="${REPO_NAME}/${REPO_BRANCH}"
|
|
||||||
|
|
||||||
# SC2129
|
|
||||||
{
|
|
||||||
echo "BRANCH=$BRANCH"
|
|
||||||
echo "BUILD=$BUILD"
|
|
||||||
echo "BUILD_RAW=$BUILD_RAW"
|
|
||||||
echo "AVVER=$AVVER"
|
|
||||||
} >> .ci/ci-vars.env
|
|
||||||
|
|
83
.github/workflows/rpcs3.yml
vendored
83
.github/workflows/rpcs3.yml
vendored
|
@ -49,7 +49,6 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CCACHE_DIR: ${{ github.workspace }}/ccache
|
CCACHE_DIR: ${{ github.workspace }}/ccache
|
||||||
CI_HAS_ARTIFACTS: true
|
|
||||||
DEPLOY_APPIMAGE: true
|
DEPLOY_APPIMAGE: true
|
||||||
APPDIR: "/rpcs3/build/appdir"
|
APPDIR: "/rpcs3/build/appdir"
|
||||||
ARTDIR: "/root/artifacts"
|
ARTDIR: "/root/artifacts"
|
||||||
|
@ -131,7 +130,6 @@ jobs:
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
env:
|
env:
|
||||||
CCACHE_DIR: /tmp/ccache_dir
|
CCACHE_DIR: /tmp/ccache_dir
|
||||||
CI_HAS_ARTIFACTS: true
|
|
||||||
QT_VER: '6.7.3'
|
QT_VER: '6.7.3'
|
||||||
QT_VER_MAIN: '6'
|
QT_VER_MAIN: '6'
|
||||||
LLVM_COMPILER_VER: '19'
|
LLVM_COMPILER_VER: '19'
|
||||||
|
@ -263,7 +261,9 @@ jobs:
|
||||||
restore-keys: ${{ runner.os }}-${{ env.COMPILER }}-
|
restore-keys: ${{ runner.os }}-${{ env.COMPILER }}-
|
||||||
|
|
||||||
- name: Download and unpack dependencies
|
- name: Download and unpack dependencies
|
||||||
run: .ci/setup-windows.sh
|
run: |
|
||||||
|
.ci/setup-windows.sh
|
||||||
|
.ci/setup-windows-ci-vars.sh win64 msvc
|
||||||
|
|
||||||
- name: Export Variables
|
- name: Export Variables
|
||||||
run: |
|
run: |
|
||||||
|
@ -321,6 +321,83 @@ jobs:
|
||||||
path: ${{ env.DEPS_CACHE_DIR }}
|
path: ${{ env.DEPS_CACHE_DIR }}
|
||||||
key: ${{ steps.restore-dependencies-cache.outputs.cache-primary-key }}
|
key: ${{ steps.restore-dependencies-cache.outputs.cache-primary-key }}
|
||||||
|
|
||||||
|
Windows_Build_Clang:
|
||||||
|
# Only run push event on master branch of main repo, but run all PRs
|
||||||
|
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
|
||||||
|
name: RPCS3 Windows Clang
|
||||||
|
runs-on: windows-2025
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- msys2: clang64
|
||||||
|
compiler: clang
|
||||||
|
arch: win64
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: 'C:\ccache'
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@main
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup msys2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
msystem: ${{ matrix.msys2 }}
|
||||||
|
update: true
|
||||||
|
cache: true
|
||||||
|
install: |
|
||||||
|
mingw-w64-clang-x86_64-clang
|
||||||
|
mingw-w64-clang-x86_64-ccache
|
||||||
|
mingw-w64-clang-x86_64-cmake
|
||||||
|
mingw-w64-clang-x86_64-lld
|
||||||
|
mingw-w64-clang-x86_64-ninja
|
||||||
|
mingw-w64-clang-x86_64-llvm
|
||||||
|
mingw-w64-clang-x86_64-ffmpeg
|
||||||
|
mingw-w64-clang-x86_64-opencv
|
||||||
|
mingw-w64-clang-x86_64-glew
|
||||||
|
mingw-w64-clang-x86_64-vulkan
|
||||||
|
mingw-w64-clang-x86_64-gtest
|
||||||
|
mingw-w64-clang-x86_64-qt6-base
|
||||||
|
mingw-w64-clang-x86_64-qt6-declarative
|
||||||
|
mingw-w64-clang-x86_64-qt6-multimedia
|
||||||
|
mingw-w64-clang-x86_64-qt6-svg
|
||||||
|
base-devel
|
||||||
|
curl
|
||||||
|
git
|
||||||
|
p7zip
|
||||||
|
|
||||||
|
- name: Restore build Ccache
|
||||||
|
uses: actions/cache/restore@main
|
||||||
|
id: restore-build-ccache
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-${{ github.run_id }}
|
||||||
|
restore-keys: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-
|
||||||
|
|
||||||
|
- name: Build RPCS3
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: |
|
||||||
|
export CCACHE_DIR=$(cygpath -u "$CCACHE_DIR")
|
||||||
|
echo "CCACHE_DIR=$CCACHE_DIR"
|
||||||
|
.ci/setup-windows-ci-vars.sh ${{ matrix.arch }} ${{ matrix.compiler }}
|
||||||
|
.ci/build-windows-clang.sh
|
||||||
|
|
||||||
|
- name: Save build Ccache
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
uses: actions/cache/save@main
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@main
|
||||||
|
with:
|
||||||
|
name: RPCS3 for Windows (${{ runner.arch }}, ${{ matrix.compiler }})
|
||||||
|
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}
|
||||||
|
compression-level: 0
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
FreeBSD_Build:
|
FreeBSD_Build:
|
||||||
# Only run push event on master branch of main repo, but run all PRs
|
# Only run push event on master branch of main repo, but run all PRs
|
||||||
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
|
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
cmake_minimum_required(VERSION 3.28)
|
cmake_minimum_required(VERSION 3.28)
|
||||||
|
|
||||||
|
find_program(CCACHE_PATH ccache HINTS ENV PATH)
|
||||||
|
if(CCACHE_PATH)
|
||||||
|
message(STATUS "Using ccache: ${CCACHE_PATH}")
|
||||||
|
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PATH}")
|
||||||
|
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PATH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
project(rpcs3 LANGUAGES C CXX)
|
project(rpcs3 LANGUAGES C CXX)
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
@ -109,11 +116,6 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
|
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_program(CCACHE_FOUND ccache)
|
|
||||||
if(CCACHE_FOUND)
|
|
||||||
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
||||||
include_directories(/opt/homebrew/include)
|
include_directories(/opt/homebrew/include)
|
||||||
link_directories(/opt/homebrew/lib)
|
link_directories(/opt/homebrew/lib)
|
||||||
|
|
51
buildfiles/cmake/CopyRuntimeDependencies.cmake
Normal file
51
buildfiles/cmake/CopyRuntimeDependencies.cmake
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
# Copy remaining DLLS
|
||||||
|
|
||||||
|
cmake_path(GET exe PARENT_PATH exe_dir)
|
||||||
|
cmake_path(CONVERT "${MSYS2_CLANG_BIN}" TO_CMAKE_PATH_LIST msys2_clang_bin)
|
||||||
|
cmake_path(CONVERT "${MSYS2_USR_BIN}" TO_CMAKE_PATH_LIST msys2_usr_bin)
|
||||||
|
|
||||||
|
message(STATUS "Getting runtime dependencies for '${exe}' in '${exe_dir}'")
|
||||||
|
message(STATUS "Dependency dirs: '${msys2_clang_bin}', '${msys2_usr_bin}'")
|
||||||
|
|
||||||
|
file(GET_RUNTIME_DEPENDENCIES EXECUTABLES ${exe}
|
||||||
|
RESOLVED_DEPENDENCIES_VAR resolved_deps
|
||||||
|
UNRESOLVED_DEPENDENCIES_VAR unresolved_deps
|
||||||
|
DIRECTORIES ${msys2_clang_bin} ${msys2_usr_bin})
|
||||||
|
|
||||||
|
foreach(dep IN LISTS resolved_deps)
|
||||||
|
cmake_path(GET dep FILENAME dep_filename)
|
||||||
|
cmake_path(GET dep PARENT_PATH dep_dir_raw)
|
||||||
|
cmake_path(CONVERT "${dep_dir_raw}" TO_CMAKE_PATH_LIST dep_dir)
|
||||||
|
|
||||||
|
string(COMPARE EQUAL "${dep_dir}" "${msys2_clang_bin}" is_clang_path)
|
||||||
|
string(COMPARE EQUAL "${dep_dir}" "${msys2_usr_bin}" is_usr_path)
|
||||||
|
|
||||||
|
set(same_path FALSE)
|
||||||
|
if(is_clang_path OR is_usr_path)
|
||||||
|
set(same_path TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(same_path)
|
||||||
|
set(dest "${exe_dir}/${dep_filename}")
|
||||||
|
if(NOT EXISTS "${dest}")
|
||||||
|
file(COPY "${dep}" DESTINATION "${exe_dir}")
|
||||||
|
message(STATUS "Copied '${dep_filename}' to '${exe_dir}'")
|
||||||
|
else()
|
||||||
|
message(STATUS "Already exists: '${dest}', skipping.")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "Found and ignored '${dep}' in '${dep_dir}'. Is clang path: ${is_clang_path}, is usr path: ${is_usr_path}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# Warn about unresolved dependencies
|
||||||
|
if(unresolved_deps)
|
||||||
|
message(WARNING "Unresolved dependencies:")
|
||||||
|
foreach(dep IN LISTS unresolved_deps)
|
||||||
|
cmake_path(GET dep PARENT_PATH dep_dir)
|
||||||
|
string(TOLOWER "${dep_dir}" dep_dir_lower)
|
||||||
|
if(NOT dep_dir_lower MATCHES ".*(windows[/\\]system32|windows[/\\]winsxs|program files).*")
|
||||||
|
message(STATUS " - ${dep_dir}/${dep}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
|
@ -158,7 +158,7 @@ if (NOT ANDROID)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
|
||||||
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt
|
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt
|
||||||
--no-translations --no-system-d3d-compiler --no-system-dxc-compiler --no-ffmpeg --no-quick-import
|
--no-translations --no-system-d3d-compiler --no-system-dxc-compiler --no-quick-import
|
||||||
--plugindir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>"
|
--plugindir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>"
|
||||||
--verbose 0 "$<TARGET_FILE:rpcs3>")
|
--verbose 0 "$<TARGET_FILE:rpcs3>")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -285,8 +285,10 @@ private:
|
||||||
|
|
||||||
libusb_context* ctx = nullptr;
|
libusb_context* ctx = nullptr;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
#if LIBUSB_API_VERSION >= 0x01000102
|
#if LIBUSB_API_VERSION >= 0x01000102
|
||||||
libusb_hotplug_callback_handle callback_handle {};
|
libusb_hotplug_callback_handle callback_handle {};
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool hotplug_supported = false;
|
bool hotplug_supported = false;
|
||||||
|
@ -302,6 +304,7 @@ void LIBUSB_CALL callback_transfer(struct libusb_transfer* transfer)
|
||||||
usbh.transfer_complete(transfer);
|
usbh.transfer_complete(transfer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
#if LIBUSB_API_VERSION >= 0x01000102
|
#if LIBUSB_API_VERSION >= 0x01000102
|
||||||
static int LIBUSB_CALL hotplug_callback(libusb_context* /*ctx*/, libusb_device * /*dev*/, libusb_hotplug_event event, void * /*user_data*/)
|
static int LIBUSB_CALL hotplug_callback(libusb_context* /*ctx*/, libusb_device * /*dev*/, libusb_hotplug_event event, void * /*user_data*/)
|
||||||
{
|
{
|
||||||
|
@ -309,6 +312,7 @@ static int LIBUSB_CALL hotplug_callback(libusb_context* /*ctx*/, libusb_device *
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if LIBUSB_API_VERSION >= 0x0100010A
|
#if LIBUSB_API_VERSION >= 0x0100010A
|
||||||
static void LIBUSB_CALL log_cb(libusb_context* /*ctx*/, enum libusb_log_level level, const char* str)
|
static void LIBUSB_CALL log_cb(libusb_context* /*ctx*/, enum libusb_log_level level, const char* str)
|
||||||
|
@ -597,9 +601,11 @@ usb_handler_thread::~usb_handler_thread()
|
||||||
libusb_free_transfer(transfers[index].transfer);
|
libusb_free_transfer(transfers[index].transfer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
#if LIBUSB_API_VERSION >= 0x01000102
|
#if LIBUSB_API_VERSION >= 0x01000102
|
||||||
if (ctx && hotplug_supported)
|
if (ctx && hotplug_supported)
|
||||||
libusb_hotplug_deregister_callback(ctx, callback_handle);
|
libusb_hotplug_deregister_callback(ctx, callback_handle);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ctx)
|
if (ctx)
|
||||||
|
|
|
@ -74,9 +74,11 @@ class perf_stat final : public perf_stat_base
|
||||||
} g_tls_perf_stat;
|
} g_tls_perf_stat;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static FORCE_INLINE SAFE_BUFFERS(void) push(u64 start_time) noexcept
|
static FORCE_INLINE SAFE_BUFFERS(void) push([[maybe_unused]] u64 start_time) noexcept
|
||||||
{
|
{
|
||||||
|
#if !defined(_WIN32) || defined(_MSC_VER) // Windows clang LTO doesn't seem to like this template
|
||||||
perf_stat_base::push(g_tls_perf_stat.m_log, start_time, perf_name<ShortName>.data());
|
perf_stat_base::push(g_tls_perf_stat.m_log, start_time, perf_name<ShortName>.data());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,12 @@ void WIN32_module_verifier::run_module_verification()
|
||||||
}
|
}
|
||||||
|
|
||||||
WCHAR wpath[MAX_PATH];
|
WCHAR wpath[MAX_PATH];
|
||||||
if (const auto len = GetModuleFileName(hModule, wpath, MAX_PATH))
|
const auto len = GetModuleFileName(hModule, wpath, MAX_PATH);
|
||||||
|
if (!len)
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (::StrStrI(wpath, windir) != wpath)
|
if (::StrStrI(wpath, windir) != wpath)
|
||||||
{
|
{
|
||||||
const std::string path = wchar_to_utf8(wpath);
|
const std::string path = wchar_to_utf8(wpath);
|
||||||
|
@ -82,7 +86,6 @@ void WIN32_module_verifier::run_module_verification()
|
||||||
report_fatal_error(error_message, true, false);
|
report_fatal_error(error_message, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIN32_module_verifier::run()
|
void WIN32_module_verifier::run()
|
||||||
|
|
|
@ -2123,6 +2123,7 @@
|
||||||
<None Include="..\.ci\build-linux.sh" />
|
<None Include="..\.ci\build-linux.sh" />
|
||||||
<None Include="..\.ci\build-mac-arm64.sh" />
|
<None Include="..\.ci\build-mac-arm64.sh" />
|
||||||
<None Include="..\.ci\build-mac.sh" />
|
<None Include="..\.ci\build-mac.sh" />
|
||||||
|
<None Include="..\.ci\build-windows-clang.sh" />
|
||||||
<None Include="..\.ci\deploy-linux-legacy.sh" />
|
<None Include="..\.ci\deploy-linux-legacy.sh" />
|
||||||
<None Include="..\.ci\deploy-linux.sh" />
|
<None Include="..\.ci\deploy-linux.sh" />
|
||||||
<None Include="..\.ci\deploy-llvm.sh" />
|
<None Include="..\.ci\deploy-llvm.sh" />
|
||||||
|
@ -2137,6 +2138,7 @@
|
||||||
<None Include="..\.ci\optimize-mac.sh" />
|
<None Include="..\.ci\optimize-mac.sh" />
|
||||||
<None Include="..\.ci\setup-llvm.sh" />
|
<None Include="..\.ci\setup-llvm.sh" />
|
||||||
<None Include="..\.ci\setup-windows.sh" />
|
<None Include="..\.ci\setup-windows.sh" />
|
||||||
|
<None Include="..\.ci\setup-windows-ci-vars.sh" />
|
||||||
<None Include="..\.github\workflows\llvm.yml" />
|
<None Include="..\.github\workflows\llvm.yml" />
|
||||||
<None Include="..\.github\workflows\qt-ts.yml" />
|
<None Include="..\.github\workflows\qt-ts.yml" />
|
||||||
<None Include="..\.github\workflows\rpcs3.yml" />
|
<None Include="..\.github\workflows\rpcs3.yml" />
|
||||||
|
|
|
@ -1815,6 +1815,9 @@
|
||||||
<None Include="..\.ci\build-mac.sh">
|
<None Include="..\.ci\build-mac.sh">
|
||||||
<Filter>CI</Filter>
|
<Filter>CI</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="..\.ci\build-windows-clang.sh">
|
||||||
|
<Filter>CI</Filter>
|
||||||
|
</None>
|
||||||
<None Include="..\.ci\deploy-linux.sh">
|
<None Include="..\.ci\deploy-linux.sh">
|
||||||
<Filter>CI</Filter>
|
<Filter>CI</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
@ -1833,6 +1836,9 @@
|
||||||
<None Include="..\.ci\setup-windows.sh">
|
<None Include="..\.ci\setup-windows.sh">
|
||||||
<Filter>CI</Filter>
|
<Filter>CI</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="..\.ci\setup-windows-ci-vars.sh">
|
||||||
|
<Filter>CI</Filter>
|
||||||
|
</None>
|
||||||
<None Include="..\.ci\install-freebsd.sh">
|
<None Include="..\.ci\install-freebsd.sh">
|
||||||
<Filter>CI</Filter>
|
<Filter>CI</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
@ -110,6 +110,7 @@ namespace utils
|
||||||
return { true, sz };
|
return { true, sz };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if !defined(ARCH_X64)
|
||||||
// Alternative way to read OS version using the registry.
|
// Alternative way to read OS version using the registry.
|
||||||
static std::string get_fallback_windows_version()
|
static std::string get_fallback_windows_version()
|
||||||
{
|
{
|
||||||
|
@ -152,6 +153,7 @@ namespace utils
|
||||||
return fmt::format("Operating system: %s, Version %s", product_name, version_id);
|
return fmt::format("Operating system: %s, Version %s", product_name, version_id);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool utils::has_ssse3()
|
bool utils::has_ssse3()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue