From e6b94df5fbf3a78adb2a97200cb1758a638ea8ac Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 12 Apr 2021 09:40:50 -0400 Subject: [PATCH] ci: Add test for macOS universal build --- .github/workflows/ci.yml | 5 +++++ tests/cmake.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 357f6c756..c9872eb82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,10 @@ jobs: - name: macOS (xcode llvm) os: macOs-latest ERROR_ON_WARNINGS: 1 + - name: macOS (xcode llvm + universal) + os: macOs-latest + ERROR_ON_WARNINGS: 1 + CMAKE_DEFINES: -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 - name: macOS (clang 11 + asan + llvm-cov) os: macOs-latest CC: clang @@ -93,6 +97,7 @@ jobs: RUN_ANALYZER: ${{ matrix.RUN_ANALYZER }} ANDROID_API: ${{ matrix.ANDROID_API }} ANDROID_NDK: ${{ matrix.ANDROID_NDK }} + CMAKE_DEFINES: ${{ matrix.CMAKE_DEFINES }} steps: - uses: actions/checkout@v2 diff --git a/tests/cmake.py b/tests/cmake.py index 2f6608dc6..c81c3cc4f 100644 --- a/tests/cmake.py +++ b/tests/cmake.py @@ -145,6 +145,8 @@ def cmake(cwd, targets, options=None): flags = "-fprofile-instr-generate -fcoverage-mapping" configcmd.append("-DCMAKE_C_FLAGS='{}'".format(flags)) configcmd.append("-DCMAKE_CXX_FLAGS='{}'".format(flags)) + if "CMAKE_DEFINES" in os.environ: + configcmd.extend(os.environ.get("CMAKE_DEFINES").split()) env = dict(os.environ) env["CFLAGS"] = env["CXXFLAGS"] = " ".join(cflags)