diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index 4c001a0..5680c40 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -13,22 +13,19 @@ jobs: run-tests: runs-on: ${{ matrix.os }} strategy: - # TODO: remove this when the workflow is stable - fail-fast: false - matrix: # Ubuntu-20.04 is being used here on purpose instead of ubuntu-latest due to a bug with clang and libstdc++ # https://github.com/actions/runner-images/issues/8659 - os: [ubuntu-20.04, windows-latest] + os: [ubuntu-20.04, windows-latest, macos-13] build_type: [Release] cpp_compiler: [g++, clang++, cl] exclude: - - os: windows-latest - cpp_compiler: g++ - os: windows-latest cpp_compiler: clang++ - os: ubuntu-20.04 cpp_compiler: cl + - os: macos-13 + cpp_compiler: cl steps: - uses: actions/checkout@v3 @@ -48,11 +45,21 @@ jobs: fi - name: Configure CMake - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -S ${{ steps.strings.outputs.build-source-dir }} + shell: bash + run: | + if [ "$RUNNER_OS" == "Windows" ] && [ "${{ matrix.cpp_compiler }}" == "g++" ]; then + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ steps.strings.outputs.build-source-dir }} + -G "MinGW Makefiles" + elif + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ steps.strings.outputs.build-source-dir }} + fi + - name: Build run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} diff --git a/cpp-tests/CMakeLists.txt b/cpp-tests/CMakeLists.txt index effd992..6f3ccd3 100644 --- a/cpp-tests/CMakeLists.txt +++ b/cpp-tests/CMakeLists.txt @@ -15,9 +15,12 @@ set(BINDINGS_SRC_DIR ${BINDINGS_BUILD_DIR}/bindings) if (WIN32) set(UNIFFI_FIXTURES_LIB uniffi_bindgen_cpp_fixtures.dll) set(ADDITIONAL_LIBS ws2_32 userenv advapi32 ntdll crypt32 Bcrypt) -else() +elseif(UNIX AND NOT APPLE) set(UNIFFI_FIXTURES_LIB libuniffi_bindgen_cpp_fixtures.so) set(ADDITIONAL_LIBS) +else() + set(UNIFFI_FIXTURES_LIB libuniffi_bindgen_cpp_fixtures.dylib) + set(ADDITIONAL_LIBS) endif() find_program(VALGRIND "valgrind")