Merge pull request #4710 from talregev/TalR/migw_libs_cmake

[MinGW][cmake] Add cmake libs in mingw
This commit is contained in:
Vitalii Koshura 2022-04-16 16:50:03 +02:00 committed by GitHub
commit 553adcf28f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 5 deletions

View File

@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
type: [libs-mingw, apps-mingw, apps-mingw-vcpkg]
type: [libs-mingw, apps-mingw, apps-mingw-vcpkg, libs-mingw-cmake]
fail-fast: false
steps:
- uses: actions/checkout@v2
@ -62,8 +62,8 @@ jobs:
# Install PowerShell
sudo apt install -y powershell
- name: Automake vcpkg apps
if: success() && matrix.type == 'apps-mingw-vcpkg'
- name: Automake vcpkg and cmake
if: success() && (contains(matrix.type, 'vcpkg') || contains(matrix.type, 'cmake'))
run: ./_autosetup
- name: Configure mingw vcpkg apps
@ -71,18 +71,28 @@ jobs:
run: |
mingw/ci_configure_apps.sh
- name: Configure libs with cmake vcpkg
if: success() && matrix.type == 'libs-mingw-cmake'
run: |
mingw/ci_configure_libs_cmake.sh
- name: Make mingw vcpkg apps
if: success() && matrix.type == 'apps-mingw-vcpkg'
run: |
mingw/ci_make_apps.sh
- name: Make for cmake
if: success() && endsWith(matrix.type, 'cmake')
run:
cmake --build build
- name: Prepare artifacts for deploy
if: ${{ success() && ! contains(matrix.type, 'libs-mingw') }}
if: success() && ! contains(matrix.type, 'libs')
run: python ./deploy/prepare_deployment.py win_${{ matrix.type }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
if: ${{ ! contains(matrix.type, 'libs') }}
if: ${{! contains(matrix.type, 'libs')}}
with:
name: win_${{ matrix.type }}_${{ github.event.pull_request.head.sha }}
path: deploy/win_${{ matrix.type }}.7z

22
mingw/bootstrap_vcpkg_cmake.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -e
PLATFORM_NAME="mingw"
if [ ! -d "$PLATFORM_NAME" ]; then
echo "start this script in the source root directory"
exit 1
fi
BUILD_DIR="$PWD/3rdParty/$PLATFORM_NAME"
VCPKG_PORTS="$PWD/3rdParty/vcpkg_ports"
VCPKG_ROOT="$BUILD_DIR/vcpkg"
if [ ! -d $VCPKG_ROOT ]; then
mkdir -p $BUILD_DIR
git -C $BUILD_DIR clone https://github.com/microsoft/vcpkg
fi
git -C $VCPKG_ROOT pull
$VCPKG_ROOT/bootstrap-vcpkg.sh

View File

@ -0,0 +1,20 @@
#!/bin/sh
set -e
PLATFORM_NAME="mingw"
if [ ! -d "$PLATFORM_NAME" ]; then
echo "start this script in the source root directory"
exit 1
fi
BUILD_DIR="$PWD/3rdParty/$PLATFORM_NAME"
VCPKG_ROOT="$BUILD_DIR/vcpkg"
VCPKG_PORTS="$PWD/3rdParty/vcpkg_ports"
TRIPLET="x64-mingw-static"
export VCPKG_DIR="$VCPKG_ROOT/installed/$TRIPLET"
$PLATFORM_NAME/bootstrap_vcpkg_cmake.sh
cmake lib -B build -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_OVERLAY_PORTS=$VCPKG_PORTS/ports -DVCPKG_OVERLAY_TRIPLETS=$VCPKG_PORTS/triplets/ci -DVCPKG_TARGET_TRIPLET=$TRIPLET -DVCPKG_INSTALL_OPTIONS=--clean-after-build