From e541fe7571286393fd3f7051f5ceb691e2729783 Mon Sep 17 00:00:00 2001 From: DH Date: Fri, 4 Apr 2025 03:25:27 +0300 Subject: [PATCH] use cmake for windows build --- .ci/deploy-windows.sh | 1 + .ci/setup-windows.sh | 6 +++--- .github/workflows/rpcs3.yml | 7 ++++--- rpcs3/3rdparty/libpng/CMakeLists.txt | 5 +++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.ci/deploy-windows.sh b/.ci/deploy-windows.sh index 8cb57b9c2..643780daa 100755 --- a/.ci/deploy-windows.sh +++ b/.ci/deploy-windows.sh @@ -15,6 +15,7 @@ mkdir ./rpcs3/bin/config mkdir ./rpcs3/bin/config/input_configs curl -fsSL 'https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt' 1> ./rpcs3/bin/config/input_configs/gamecontrollerdb.txt curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 1> ./rpcs3/bin/GuiConfigs/compat_database.dat +cp -rf ./rpcs3/build/bin/ ./rpcs3/bin/ # Download SSL certificate (not needed with CURLSSLOPT_NATIVE_CA) #curl -fsSL 'https://curl.haxx.se/ca/cacert.pem' 1> ./bin/cacert.pem diff --git a/.ci/setup-windows.sh b/.ci/setup-windows.sh index 80a257afe..9c60332e7 100755 --- a/.ci/setup-windows.sh +++ b/.ci/setup-windows.sh @@ -19,8 +19,8 @@ QT_DECL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtdeclarative${QT_SUFFIX}" QT_TOOL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qttools${QT_SUFFIX}" QT_MM_URL="${QT_HOST}${QT_PREFIX}addons.qtmultimedia.${QT_PREFIX_2}qtmultimedia${QT_SUFFIX}" QT_SVG_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtsvg${QT_SUFFIX}" -LLVMLIBS_URL="https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-${LLVM_VER}/llvmlibs_mt.7z" -GLSLANG_URL='https://github.com/RPCS3/glslang/releases/latest/download/glslanglibs_mt.7z' +# LLVMLIBS_URL="https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-${LLVM_VER}/llvmlibs_mt.7z" +# GLSLANG_URL='https://github.com/RPCS3/glslang/releases/latest/download/glslanglibs_mt.7z' VULKAN_SDK_URL="https://www.dropbox.com/scl/fi/sjjh0fc4ld281pjbl2xzu/VulkanSDK-${VULKAN_VER}-Installer.exe?rlkey=f6wzc0lvms5vwkt2z3qabfv9d&dl=1" CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.11.2/ccache-4.11.2-windows-x86_64.zip" @@ -41,7 +41,7 @@ DEP_URLS=" \ # 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 --depth=1 --jobs=8 $(awk '/path/ && !/FAudio/ && !/llvm/ { print $3 }' .gitmodules) +git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/FAudio/ { print $3 }' .gitmodules) # Git bash doesn't have rev, so here it is rev() diff --git a/.github/workflows/rpcs3.yml b/.github/workflows/rpcs3.yml index 00236a061..0ada21f36 100644 --- a/.github/workflows/rpcs3.yml +++ b/.github/workflows/rpcs3.yml @@ -104,7 +104,6 @@ jobs: fetch-depth: 0 - name: Setup env - shell: pwsh run: | echo "QTDIR=C:\Qt\${{ env.QT_VER }}\${{ env.QT_VER_MSVC }}_64" >> ${{ github.env }} echo "VULKAN_SDK=C:\VulkanSDK\${{ env.VULKAN_VER }}" >> ${{ github.env }} @@ -141,8 +140,10 @@ jobs: uses: microsoft/setup-msbuild@main - name: Compile RPCS3 - shell: pwsh - run: msbuild rpcs3/rpcs3.sln /p:Configuration=Release /v:minimal /p:Platform=x64 /p:CLToolPath=${{ env.CCACHE_BIN_DIR }} /p:UseMultiToolTask=true /p:CustomAfterMicrosoftCommonTargets="${{ github.workspace }}\rpcs3\buildfiles\msvc\ci_only.targets" + run: | + cd rpcs3 + cmake --preset msvc -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DQt6_DIR="$QTDIR" + cmake --build --preset msvc-release - name: Pack up build artifacts run: | diff --git a/rpcs3/3rdparty/libpng/CMakeLists.txt b/rpcs3/3rdparty/libpng/CMakeLists.txt index f24c2c970..e7a2c72f7 100644 --- a/rpcs3/3rdparty/libpng/CMakeLists.txt +++ b/rpcs3/3rdparty/libpng/CMakeLists.txt @@ -5,6 +5,11 @@ if (NOT USE_SYSTEM_LIBPNG) set(PNG_SHARED OFF CACHE BOOL "Build shared lib") set(PNG_TESTS OFF CACHE BOOL "Build libpng tests") set(SKIP_INSTALL_ALL ON) + + if (NOT USE_SYSTEM_ZLIB AND MSVC) + set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} /I${CMAKE_CURRENT_BINARY_DIR}/../zlib/zlib /I${CMAKE_CURRENT_SOURCE_DIR}/../zlib/zlib) + endif() + add_subdirectory(libpng EXCLUDE_FROM_ALL) target_include_directories(png_static INTERFACE "${libpng_BINARY_DIR}" "${libpng_SOURCE_DIR}")