Skip to content

Merge pull request #1631 from Karry/visual-cache-flush #46

Merge pull request #1631 from Karry/visual-cache-flush

Merge pull request #1631 from Karry/visual-cache-flush #46

name: Visual Studio 2019
on:
pull_request:
branches:
- master
push:
branches:
- master
paths-ignore:
- '.github/workflows/**'
jobs:
build_cmake:
name: cmake
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Copy vcpkg.json
run: copy vcpkg_medium.json vcpkg.json
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
# Restore from cache the previously built ports. If cache-miss, download and build vcpkg (aka "bootstrap vcpkg").
- name: Restore from cache and install vcpkg
# Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
uses: lukka/run-vcpkg@v11.4
with:
runVcpkgInstall: false
vcpkgJsonGlob: '**/vcpkg.json'
vcpkgGitCommitId: f6a5d4e8eb7476b8d7fc12a56dff300c1c986131 # https://github.com/microsoft/vcpkg/releases/tag/2023.06.20
- name: Create build directory
run: mkdir build
- name: Configure build project
run: cmake -G "Visual Studio 16 2019" -A x64 -DOSMSCOUT_BUILD_DOC_API=OFF -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake -Wno-dev ..
working-directory: build
- name: Build project
run: cmake --build build
- name: Create distribution directory
run: mkdir dist
- name: Collect libosmscout
run: copy /Y build\libosmscout\Debug\*.dll dist
shell: cmd
- name: Collect libosmscout-import
run: copy /Y build\libosmscout-import\Debug\*.dll dist
shell: cmd
- name: Collect libosmscout-map
run: copy /Y build\libosmscout-map\Debug\*.dll dist
shell: cmd
- name: Collect libosmscout-map-cairo
run: copy /Y build\libosmscout-map-cairo\Debug\*.dll dist
shell: cmd
- name: Collect libosmscout-map-directx
run: copy /Y build\libosmscout-map-directx\Debug\*.dll dist
shell: cmd
- name: Collect libosmscout-map-gdi
run: copy /Y build\libosmscout-map-gdi\Debug\*.dll dist
shell: cmd
- name: Collect libosmscout-map-svg
run: copy /Y build\libosmscout-map-svg\Debug\*.dll dist
shell: cmd
- name: Collect Import
run: copy /Y build\Import\Debug\*.exe dist
shell: cmd
- name: Collect Demos
run: copy /Y build\Demos\Debug\*.exe dist
shell: cmd
- name: Upload distribution archive
uses: actions/upload-artifact@v4
with:
name: Libosmscout_Windows.zip
path: dist
build_meson:
name: meson
runs-on: windows-2019
defaults:
run:
shell: cmd
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python 3.x for meson
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install meson and ninja
run: pip install meson ninja
- name: Prepare MSVC
uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64
- name: Configure build project
run: meson setup --buildtype debugoptimized --wrap-mode nofallback --unity on -DenableXML=false build
- name: Dump found dependencies
run: meson introspect --dependencies
working-directory: build
- name: Build project
run: meson compile -C build
- name: Test project
run: meson test -C build --print-errorlogs