mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-24 03:47:18 +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:
commit
3a45e6dae1
35
.github/workflows/github.yml
vendored
35
.github/workflows/github.yml
vendored
@ -38,6 +38,7 @@ jobs:
|
|||||||
os: macos-13
|
os: macos-13
|
||||||
test: 0
|
test: 0
|
||||||
pack: 1
|
pack: 1
|
||||||
|
upload: 1
|
||||||
pack_type: Release
|
pack_type: Release
|
||||||
extension: dmg
|
extension: dmg
|
||||||
before_install: macos.sh
|
before_install: macos.sh
|
||||||
@ -50,6 +51,7 @@ jobs:
|
|||||||
os: macos-13
|
os: macos-13
|
||||||
test: 0
|
test: 0
|
||||||
pack: 1
|
pack: 1
|
||||||
|
upload: 1
|
||||||
pack_type: Release
|
pack_type: Release
|
||||||
extension: dmg
|
extension: dmg
|
||||||
before_install: macos.sh
|
before_install: macos.sh
|
||||||
@ -62,6 +64,7 @@ jobs:
|
|||||||
os: macos-13
|
os: macos-13
|
||||||
test: 0
|
test: 0
|
||||||
pack: 1
|
pack: 1
|
||||||
|
upload: 1
|
||||||
pack_type: Release
|
pack_type: Release
|
||||||
extension: ipa
|
extension: ipa
|
||||||
before_install: macos.sh
|
before_install: macos.sh
|
||||||
@ -69,7 +72,7 @@ jobs:
|
|||||||
conan_profile: ios-arm64
|
conan_profile: ios-arm64
|
||||||
conan_prebuilts: dependencies-ios
|
conan_prebuilts: dependencies-ios
|
||||||
conan_options: --options with_apple_system_libs=True
|
conan_options: --options with_apple_system_libs=True
|
||||||
- platform: msvc
|
- platform: msvc-x64
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
test: 0
|
test: 0
|
||||||
pack: 1
|
pack: 1
|
||||||
@ -77,10 +80,19 @@ jobs:
|
|||||||
extension: exe
|
extension: exe
|
||||||
before_install: msvc.sh
|
before_install: msvc.sh
|
||||||
preset: windows-msvc-release
|
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
|
- platform: mingw_x86_64
|
||||||
os: ubuntu-24.04
|
os: ubuntu-24.04
|
||||||
test: 0
|
test: 0
|
||||||
pack: 1
|
pack: 1
|
||||||
|
upload: 1
|
||||||
pack_type: Release
|
pack_type: Release
|
||||||
extension: exe
|
extension: exe
|
||||||
cmake_args: -G Ninja
|
cmake_args: -G Ninja
|
||||||
@ -101,6 +113,7 @@ jobs:
|
|||||||
conan_prebuilts: dependencies-mingw-x86
|
conan_prebuilts: dependencies-mingw-x86
|
||||||
- platform: android-32
|
- platform: android-32
|
||||||
os: ubuntu-24.04
|
os: ubuntu-24.04
|
||||||
|
upload: 1
|
||||||
extension: apk
|
extension: apk
|
||||||
preset: android-conan-ninja-release
|
preset: android-conan-ninja-release
|
||||||
before_install: android.sh
|
before_install: android.sh
|
||||||
@ -109,6 +122,7 @@ jobs:
|
|||||||
artifact_platform: armeabi-v7a
|
artifact_platform: armeabi-v7a
|
||||||
- platform: android-64
|
- platform: android-64
|
||||||
os: ubuntu-24.04
|
os: ubuntu-24.04
|
||||||
|
upload: 1
|
||||||
extension: apk
|
extension: apk
|
||||||
preset: android-conan-ninja-release
|
preset: android-conan-ninja-release
|
||||||
before_install: android.sh
|
before_install: android.sh
|
||||||
@ -136,6 +150,10 @@ jobs:
|
|||||||
if: "${{ matrix.conan_prebuilts != '' }}"
|
if: "${{ matrix.conan_prebuilts != '' }}"
|
||||||
run: source '${{github.workspace}}/CI/install_conan_dependencies.sh' '${{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
|
# 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
|
# fall back to ccache of the vcmi/vcmi repo if no PR-specific ccache is found
|
||||||
- name: ccache for PRs
|
- name: ccache for PRs
|
||||||
@ -232,11 +250,11 @@ jobs:
|
|||||||
elif [[ (${{matrix.preset}} == android-conan-ninja-release) && (${{github.ref}} != 'refs/heads/master') ]]
|
elif [[ (${{matrix.preset}} == android-conan-ninja-release) && (${{github.ref}} != 'refs/heads/master') ]]
|
||||||
then
|
then
|
||||||
cmake -DENABLE_CCACHE:BOOL=ON -DANDROID_GRADLE_PROPERTIES="applicationIdSuffix=.daily;signingConfig=dailySigning;applicationLabel=VCMI daily" --preset ${{ matrix.preset }}
|
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
|
then
|
||||||
cmake -DENABLE_CCACHE:BOOL=ON --preset ${{ matrix.preset }}
|
|
||||||
else
|
|
||||||
cmake --preset ${{ matrix.preset }}
|
cmake --preset ${{ matrix.preset }}
|
||||||
|
else
|
||||||
|
cmake -DENABLE_CCACHE:BOOL=ON --preset ${{ matrix.preset }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
@ -273,12 +291,14 @@ jobs:
|
|||||||
sleep 3
|
sleep 3
|
||||||
((counter++))
|
((counter++))
|
||||||
done
|
done
|
||||||
|
rm -rf _CPack_Packages
|
||||||
|
|
||||||
- name: Artifacts
|
- name: Artifacts
|
||||||
if: ${{ matrix.pack == 1 }}
|
if: ${{ matrix.pack == 1 }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
|
||||||
|
compression-level: 0
|
||||||
path: |
|
path: |
|
||||||
${{github.workspace}}/out/build/${{matrix.preset}}/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
|
${{github.workspace}}/out/build/${{matrix.preset}}/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
|
||||||
|
|
||||||
@ -299,6 +319,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
|
||||||
|
compression-level: 0
|
||||||
path: |
|
path: |
|
||||||
${{ env.ANDROID_APK_PATH }}
|
${{ env.ANDROID_APK_PATH }}
|
||||||
|
|
||||||
@ -307,19 +328,21 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - aab
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - aab
|
||||||
|
compression-level: 0
|
||||||
path: |
|
path: |
|
||||||
${{ env.ANDROID_AAB_PATH }}
|
${{ env.ANDROID_AAB_PATH }}
|
||||||
|
|
||||||
- name: Upload debug symbols
|
- name: Upload debug symbols
|
||||||
if: ${{ matrix.platform == 'msvc' }}
|
if: ${{ startsWith(matrix.platform, 'msvc') }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - symbols
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - symbols
|
||||||
|
compression-level: 9
|
||||||
path: |
|
path: |
|
||||||
${{github.workspace}}/**/*.pdb
|
${{github.workspace}}/**/*.pdb
|
||||||
|
|
||||||
- name: Upload build
|
- 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
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
if [ -z '${{ env.ANDROID_APK_PATH }}' ] ; then
|
if [ -z '${{ env.ANDROID_APK_PATH }}' ] ; then
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
curl -LfsS -o "vcpkg-export-${VCMI_BUILD_PLATFORM}-windows-v143.7z" \
|
#!/usr/bin/env bash
|
||||||
"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"
|
|
||||||
|
|
||||||
#rm -r -f vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug
|
MSVC_INSTALL_PATH=$(vswhere -latest -property installationPath)
|
||||||
#mkdir -p vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug/bin
|
echo "MSVC_INSTALL_PATH = $MSVC_INSTALL_PATH"
|
||||||
#cp vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/bin/* vcpkg/installed/${VCMI_BUILD_PLATFORM}-windows/debug/bin
|
echo "Installed toolset versions:"
|
||||||
|
ls -vr "$MSVC_INSTALL_PATH/VC/Tools/MSVC"
|
||||||
|
|
||||||
DUMPBIN_DIR=$(vswhere -latest -find **/dumpbin.exe | head -n 1)
|
TOOLS_DIR=$(ls -vr "$MSVC_INSTALL_PATH/VC/Tools/MSVC/" | head -1)
|
||||||
dirname "$DUMPBIN_DIR" > $GITHUB_PATH
|
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"
|
||||||
|
7
CI/install_vcpkg_dependencies.sh
Normal file
7
CI/install_vcpkg_dependencies.sh
Normal 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
|
@ -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",
|
"name": "windows-msvc-release-ccache",
|
||||||
"displayName": "Windows x64 RelWithDebInfo with ccache",
|
"displayName": "Windows x64 RelWithDebInfo with ccache",
|
||||||
@ -382,6 +395,11 @@
|
|||||||
"configurePreset": "windows-msvc-release",
|
"configurePreset": "windows-msvc-release",
|
||||||
"inherits": "default-release"
|
"inherits": "default-release"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "windows-msvc-release-x86",
|
||||||
|
"configurePreset": "windows-msvc-release-x86",
|
||||||
|
"inherits": "default-release"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "windows-msvc-release-ccache",
|
"name": "windows-msvc-release-ccache",
|
||||||
"configurePreset": "windows-msvc-release-ccache",
|
"configurePreset": "windows-msvc-release-ccache",
|
||||||
|
5
Global.h
5
Global.h
@ -154,7 +154,10 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
|||||||
#endif
|
#endif
|
||||||
#define BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE 1
|
#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
|
//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
|
#define BOOST_BIND_NO_PLACEHOLDERS
|
||||||
|
|
||||||
#if BOOST_VERSION >= 106600
|
#if BOOST_VERSION >= 106600
|
||||||
|
Loading…
x
Reference in New Issue
Block a user