1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-08 00:39:47 +02:00

Merge pull request #4829 from IvanSavenko/msvc_package

Add support for Win7 and 32-bit msvc+vcpkg builds
This commit is contained in:
Ivan Savenko 2024-10-28 13:04:45 +02:00 committed by GitHub
commit 3a45e6dae1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 73 additions and 15 deletions

View File

@ -38,6 +38,7 @@ jobs:
os: macos-13
test: 0
pack: 1
upload: 1
pack_type: Release
extension: dmg
before_install: macos.sh
@ -50,6 +51,7 @@ jobs:
os: macos-13
test: 0
pack: 1
upload: 1
pack_type: Release
extension: dmg
before_install: macos.sh
@ -62,6 +64,7 @@ jobs:
os: macos-13
test: 0
pack: 1
upload: 1
pack_type: Release
extension: ipa
before_install: macos.sh
@ -69,7 +72,7 @@ jobs:
conan_profile: ios-arm64
conan_prebuilts: dependencies-ios
conan_options: --options with_apple_system_libs=True
- platform: msvc
- platform: msvc-x64
os: windows-latest
test: 0
pack: 1
@ -77,10 +80,19 @@ jobs:
extension: exe
before_install: msvc.sh
preset: windows-msvc-release
- platform: msvc-x86
os: windows-latest
test: 0
pack: 1
pack_type: RelWithDebInfo
extension: exe
before_install: msvc.sh
preset: windows-msvc-release-x86
- platform: mingw_x86_64
os: ubuntu-24.04
test: 0
pack: 1
upload: 1
pack_type: Release
extension: exe
cmake_args: -G Ninja
@ -101,6 +113,7 @@ jobs:
conan_prebuilts: dependencies-mingw-x86
- platform: android-32
os: ubuntu-24.04
upload: 1
extension: apk
preset: android-conan-ninja-release
before_install: android.sh
@ -109,6 +122,7 @@ jobs:
artifact_platform: armeabi-v7a
- platform: android-64
os: ubuntu-24.04
upload: 1
extension: apk
preset: android-conan-ninja-release
before_install: android.sh
@ -136,6 +150,10 @@ jobs:
if: "${{ matrix.conan_prebuilts != '' }}"
run: source '${{github.workspace}}/CI/install_conan_dependencies.sh' '${{matrix.conan_prebuilts}}'
- name: Install vcpkg Dependencies
if: ${{ startsWith(matrix.platform, 'msvc') }}
run: source '${{github.workspace}}/CI/install_vcpkg_dependencies.sh' '${{matrix.platform}}'
# ensure the ccache for each PR is separate so they don't interfere with each other
# fall back to ccache of the vcmi/vcmi repo if no PR-specific ccache is found
- name: ccache for PRs
@ -232,11 +250,11 @@ jobs:
elif [[ (${{matrix.preset}} == android-conan-ninja-release) && (${{github.ref}} != 'refs/heads/master') ]]
then
cmake -DENABLE_CCACHE:BOOL=ON -DANDROID_GRADLE_PROPERTIES="applicationIdSuffix=.daily;signingConfig=dailySigning;applicationLabel=VCMI daily" --preset ${{ matrix.preset }}
elif [[ ${{matrix.platform}} != msvc ]]
elif [[ ${{startsWith(matrix.platform, 'msvc') }} ]]
then
cmake -DENABLE_CCACHE:BOOL=ON --preset ${{ matrix.preset }}
else
cmake --preset ${{ matrix.preset }}
else
cmake -DENABLE_CCACHE:BOOL=ON --preset ${{ matrix.preset }}
fi
- name: Build
@ -273,12 +291,14 @@ jobs:
sleep 3
((counter++))
done
rm -rf _CPack_Packages
- name: Artifacts
if: ${{ matrix.pack == 1 }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
compression-level: 0
path: |
${{github.workspace}}/out/build/${{matrix.preset}}/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
@ -299,6 +319,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
compression-level: 0
path: |
${{ env.ANDROID_APK_PATH }}
@ -307,19 +328,21 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - aab
compression-level: 0
path: |
${{ env.ANDROID_AAB_PATH }}
- name: Upload debug symbols
if: ${{ matrix.platform == 'msvc' }}
if: ${{ startsWith(matrix.platform, 'msvc') }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - symbols
compression-level: 9
path: |
${{github.workspace}}/**/*.pdb
- name: Upload build
if: ${{ (matrix.pack == 1 || startsWith(matrix.platform, 'android')) && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/features/')) && matrix.platform != 'msvc' && matrix.platform != 'mingw-32' }}
if: ${{ (matrix.upload == 1) && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/features/')) }}
continue-on-error: true
run: |
if [ -z '${{ env.ANDROID_APK_PATH }}' ] ; then

View File

@ -1,10 +1,17 @@
curl -LfsS -o "vcpkg-export-${VCMI_BUILD_PLATFORM}-windows-v143.7z" \
"https://github.com/vcmi/vcmi-deps-windows/releases/download/v1.7/vcpkg-export-${VCMI_BUILD_PLATFORM}-windows-v143.7z"
7z x "vcpkg-export-${VCMI_BUILD_PLATFORM}-windows-v143.7z"
#!/usr/bin/env bash
#rm -r -f vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug
#mkdir -p vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug/bin
#cp vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/bin/* vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug/bin
MSVC_INSTALL_PATH=$(vswhere -latest -property installationPath)
echo "MSVC_INSTALL_PATH = $MSVC_INSTALL_PATH"
echo "Installed toolset versions:"
ls -vr "$MSVC_INSTALL_PATH/VC/Tools/MSVC"
DUMPBIN_DIR=$(vswhere -latest -find **/dumpbin.exe | head -n 1)
dirname "$DUMPBIN_DIR" > $GITHUB_PATH
TOOLS_DIR=$(ls -vr "$MSVC_INSTALL_PATH/VC/Tools/MSVC/" | head -1)
DUMPBIN_PATH="$MSVC_INSTALL_PATH/VC/Tools/MSVC/$TOOLS_DIR/bin/Hostx64/x64/dumpbin.exe"
# This command should work as well, but for some reason it is *extremely* slow on the Github CI (~7 minutes)
#DUMPBIN_PATH=$(vswhere -latest -find **/dumpbin.exe | head -n 1)
echo "TOOLS_DIR = $TOOLS_DIR"
echo "DUMPBIN_PATH = $DUMPBIN_PATH"
dirname "$DUMPBIN_PATH" > "$GITHUB_PATH"

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
RELEASE_TAG="v1.8"
FILENAME="dependencies-$1"
DOWNLOAD_URL="https://github.com/vcmi/vcmi-deps-windows/releases/download/$RELEASE_TAG/$FILENAME.txz"
curl -L "$DOWNLOAD_URL" | tar -xf - --xz

View File

@ -154,6 +154,19 @@
}
},
{
"name": "windows-msvc-release-x86",
"displayName": "Windows x86 RelWithDebInfo",
"description": "VCMI RelWithDebInfo build",
"inherits": "default-release",
"generator": "Visual Studio 17 2022",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
"FORCE_BUNDLED_MINIZIP": "ON",
"CMAKE_GENERATOR_PLATFORM": "WIN32"
}
},
{
"name": "windows-msvc-release-ccache",
"displayName": "Windows x64 RelWithDebInfo with ccache",
@ -382,6 +395,11 @@
"configurePreset": "windows-msvc-release",
"inherits": "default-release"
},
{
"name": "windows-msvc-release-x86",
"configurePreset": "windows-msvc-release-x86",
"inherits": "default-release"
},
{
"name": "windows-msvc-release-ccache",
"configurePreset": "windows-msvc-release-ccache",

View File

@ -154,7 +154,10 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
#endif
#define BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE 1
//need to link boost thread dynamically to avoid https://stackoverflow.com/questions/35978572/boost-thread-interupt-does-not-work-when-crossing-a-dll-boundary
#define BOOST_THREAD_USE_DLL //for example VCAI::finish() may freeze on thread join after interrupt when linking this statically
//for example VCAI::finish() may freeze on thread join after interrupt when linking this statically
#ifndef BOOST_THREAD_USE_DLL
# define BOOST_THREAD_USE_DLL
#endif
#define BOOST_BIND_NO_PLACEHOLDERS
#if BOOST_VERSION >= 106600