-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Windows clang -- proof-of-concept #17579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
qurious-pixel
wants to merge
13
commits into
RPCS3:master
Choose a base branch
from
qurious-pixel:windows-clang
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+334
−40
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
42c7f13
clang-cl
qurious-pixel d243055
Update deploy-mac.sh
qurious-pixel 47b938c
Merge branch 'master' into windows-clang
qurious-pixel fd2576f
LLVM 19.1.7
qurious-pixel 2b35b80
Merge branch 'master' into windows-clang
qurious-pixel 451d6e0
Updated OpenAL to 9c50193
qurious-pixel 4a009b1
Merge branch 'master' into windows-clang
qurious-pixel 8228ae6
Fix compile flags for MSVC and Clang in CMakeLists
qurious-pixel 97a1a50
Merge branch 'master' into windows-clang
qurious-pixel 42a8f7d
Merge branch 'master' into windows-clang
qurious-pixel c902134
Windows build shell script
qurious-pixel 1148253
Fix shell for Windows sh script
qurious-pixel d1e7fe4
Merge branch 'master' into windows-clang
qurious-pixel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#!/bin/sh -e | ||
|
||
echo "Starting RPCS3 build (Bash script)" | ||
|
||
# Automatically find clang_rt.builtins-x86_64.lib | ||
echo "Searching for clang_rt.builtins-x86_64.lib ..." | ||
clangBuiltinsLibPath=$(find "C:\Program Files\LLVM\lib\clang" -name "clang_rt.builtins-x86_64.lib" | sed 's|Program Files|PROGRA~1|g') | ||
|
||
if [ -z "$clangBuiltinsLibPath" ]; then | ||
echo "ERROR: Could not find clang_rt.builtins-x86_64.lib in LLVM installation." | ||
exit 1 | ||
fi | ||
|
||
clangBuiltinsDir=$(dirname "$clangBuiltinsLibPath") | ||
clangBuiltinsLib=$(basename "$clangBuiltinsLibPath") | ||
# shellcheck disable=SC2028 | ||
clangPath=$(echo "C:\Program Files\LLVM\bin" | sed 's|Program Files|PROGRA~1|g') | ||
|
||
echo "Found Clang builtins library: $clangBuiltinsLib in $clangBuiltinsDir" | ||
echo "Found Clang Path: $clangPath" | ||
|
||
# Search for mt.exe in SDK bin directories | ||
echo "Searching for llvm-mt.exe ..." | ||
mtPath=$(find "$clangPath" -name "llvm-mt.exe") | ||
|
||
if [ -z "$mtPath" ]; then | ||
echo "ERROR: Could not find llvm-mt.exe in SDK directories." | ||
exit 1 | ||
fi | ||
|
||
echo "Found llvm-mt.exe at: $mtPath" | ||
|
||
VcpkgRoot="$(pwd)/vcpkg" | ||
VcpkgTriplet="$VCPKG_TRIPLET" | ||
VcpkgInstall="$VcpkgRoot/installed/$VcpkgTriplet" | ||
VcpkgInclude="$VcpkgInstall/include" | ||
VcpkgLib="$VcpkgInstall/lib" | ||
|
||
# Configure git safe directory | ||
echo "Configuring git safe directory" | ||
git config --global --add safe.directory '*' | ||
|
||
# Initialize submodules except certain ones | ||
echo "Initializing submodules" | ||
# shellcheck disable=SC2046 | ||
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/FAudio/ && !/libpng/ && !/zlib/ && !/feralinteractive/ { print $3 }' .gitmodules) | ||
|
||
# Create and enter build directory | ||
echo "Creating build directory" | ||
mkdir -p build | ||
cd build || exit | ||
echo "Changed directory to: $(pwd)" | ||
|
||
# Run CMake with Ninja generator and required flags | ||
echo "Running CMake configuration" | ||
cmake .. \ | ||
-G Ninja \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_C_COMPILER="${clangPath}/clang-cl.exe" \ | ||
-DCMAKE_CXX_COMPILER="${clangPath}/clang-cl.exe" \ | ||
-DCMAKE_LINKER="${clangPath}/lld-link.exe" \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-DCMAKE_TOOLCHAIN_FILE="$VcpkgRoot/scripts/buildsystems/vcpkg.cmake" \ | ||
-DCMAKE_EXE_LINKER_FLAGS="/LIBPATH:${clangBuiltinsDir} /defaultlib:${clangBuiltinsLib}" \ | ||
-DCMAKE_MT="${mtPath}" \ | ||
-DUSE_NATIVE_INSTRUCTIONS=OFF \ | ||
-DUSE_PRECOMPILED_HEADERS=OFF \ | ||
-DVCPKG_TARGET_TRIPLET="$VcpkgTriplet" \ | ||
-DFFMPEG_INCLUDE_DIR="$VcpkgInclude" \ | ||
-DFFMPEG_LIBAVCODEC="$VcpkgLib/avcodec.lib" \ | ||
-DFFMPEG_LIBAVFORMAT="$VcpkgLib/avformat.lib" \ | ||
-DFFMPEG_LIBAVUTIL="$VcpkgLib/avutil.lib" \ | ||
-DFFMPEG_LIBSWSCALE="$VcpkgLib/swscale.lib" \ | ||
-DFFMPEG_LIBSWRESAMPLE="$VcpkgLib/swresample.lib" \ | ||
-DUSE_SYSTEM_CURL=OFF \ | ||
-DUSE_FAUDIO=OFF \ | ||
-DUSE_SDL=ON \ | ||
-DUSE_SYSTEM_SDL=OFF \ | ||
-DUSE_SYSTEM_FFMPEG=ON \ | ||
-DUSE_SYSTEM_OPENCV=ON \ | ||
-DUSE_SYSTEM_OPENAL=OFF \ | ||
-DUSE_SYSTEM_LIBPNG=ON \ | ||
-DUSE_DISCORD_RPC=ON \ | ||
-DUSE_SYSTEM_ZSTD=ON \ | ||
-DWITH_LLVM=ON \ | ||
-DSTATIC_LINK_LLVM=ON \ | ||
-DBUILD_RPCS3_TESTS=OFF | ||
|
||
echo "CMake configuration complete" | ||
|
||
# Build with ninja | ||
echo "Starting build with Ninja..." | ||
ninja | ||
|
||
echo "Build succeeded" | ||
|
||
# Go back to root directory | ||
cd .. | ||
echo "Returned to root directory: $(pwd)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/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-cl $CPU_ARCH" | ||
|
||
# First let's print some info about our caches | ||
C:/Strawberry/c/bin/ccache.exe --show-stats -v | ||
|
||
# BUILD_blablabla is CI specific, so we wrap it for portability | ||
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY" | ||
|
||
# Remove unecessary files | ||
rm -f ./bin/vulkan-1.dll | ||
|
||
# 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 | ||
|
||
# Download SSL certificate (not needed with CURLSSLOPT_NATIVE_CA) | ||
#curl -fsSL 'https://curl.haxx.se/ca/cacert.pem' 1> ./bin/cacert.pem | ||
|
||
# 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 "$ARTIFACT_DIR" | ||
cp -- "$BUILD" "$ARTIFACT_DIR" | ||
cp -- "$BUILD.sha256" "$ARTIFACT_DIR" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule openal-soft
updated
382 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comment for this section