Add support for C++20 modules #268
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macOS | |
# Turning off macOS CI build since Apple Clang doesn't support C++20 modules | |
#on: [push, pull_request] | |
on: [pull_request] | |
jobs: | |
xcode: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: [Debug, Release] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 | |
- name: Cache vcpkg | |
uses: actions/[email protected] | |
id: cache-vcpkg | |
with: | |
path: build/vcpkg_cache/ | |
key: vcpkg-binaries-osx-${{ hashFiles('vcpkg.json') }} | |
- name: Create Build Environment | |
if: ${{ !steps.cache-vcpkg.outputs.cache-hit }} | |
run: | | |
cmake -E make_directory build | |
cmake -E make_directory build/vcpkg_cache | |
- name: Boostrap vcpkg | |
shell: pwsh | |
working-directory: vcpkg/ | |
run: | | |
./bootstrap-vcpkg.sh | |
./vcpkg integrate install | |
- name: Configure | |
shell: pwsh | |
env: | |
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
working-directory: build/ | |
run: | | |
$vcpkgToolchain = Join-Path $env:VCPKG_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve | |
$cmakeBuildType = '${{ matrix.config }}' | |
$cachedBinaries = Join-Path $(Get-Location) './vcpkg_cache/' -Resolve | |
$cacheAccess = $(if ('${{ steps.cache-vcpkg.outputs.cache-hit }}' -eq 'true') { 'read' } else { 'write' }) | |
$env:VCPKG_BINARY_SOURCES = "clear;files,$cachedBinaries,$cacheAccess" | |
$env:PATH = "${env:PATH}:${{ github.workspace }}/ninja-build" | |
cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DCMAKE_BUILD_TYPE=$cmakeBuildType" -G Ninja ${{ github.workspace }} | |
- name: Build | |
working-directory: build/ | |
run: cmake --build . -j -v | |
- name: Test | |
working-directory: build/ | |
run: ctest --output-on-failure |