diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index d432b447cb..86c59198dd 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -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 diff --git a/mingw/bootstrap_vcpkg_cmake.sh b/mingw/bootstrap_vcpkg_cmake.sh new file mode 100755 index 0000000000..9bc014f764 --- /dev/null +++ b/mingw/bootstrap_vcpkg_cmake.sh @@ -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 diff --git a/mingw/ci_configure_libs_cmake.sh b/mingw/ci_configure_libs_cmake.sh new file mode 100755 index 0000000000..f203c8bfd0 --- /dev/null +++ b/mingw/ci_configure_libs_cmake.sh @@ -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