Build CMake on GitHub Actions

Also, resolve CMake build problems on macOS:
Pass CMAKE_OSX_SYSROOT as an environment variable SDKROOT when buildind the arch_flags executable.
This commit is contained in:
Baruch Sterin 2022-01-23 00:16:10 +01:00
parent 2ccb0f7834
commit 0a536417f6
5 changed files with 11 additions and 5 deletions

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
MAKE_ARGS: ${{ matrix.use_namespace && '-DABC_USE_NAMESPACE=ON' || '' }}
CMAKE_ARGS: ${{ matrix.use_namespace && '-DABC_USE_NAMESPACE=xxx' || '' }}
DEMO_ARGS: ${{ matrix.use_namespace && '-DABC_NAMESPACE=xxx' || '' }}
DEMO_GCC: ${{ matrix.use_namespace && 'g++ -x c++' || 'gcc' }}
@ -34,7 +34,7 @@ jobs:
- name: Configure CMake
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS} -B build
- name: Build CMake
run: |
@ -53,7 +53,7 @@ jobs:
- name: Stage Executable
run: |
mkdir staging
cp abc libabc.a staging/
cp build/abc build/libabc.a staging/
- name: Upload pacakge artifact
uses: actions/upload-artifact@v1

View File

@ -47,9 +47,14 @@ if(ABC_USE_NAMESPACE)
set(ABC_USE_NAMESPACE_FLAGS "ABC_USE_NAMESPACE=${ABC_USE_NAMESPACE}")
endif()
if( APPLE )
set(make_env ${CMAKE_COMMAND} -E env SDKROOT=${CMAKE_OSX_SYSROOT})
endif()
# run make to extract compiler options, linker options and list of source files
execute_process(
COMMAND
${make_env}
make
${ABC_READLINE_FLAGS}
${ABC_USE_NAMESPACE_FLAGS}

View File

@ -1,5 +1,6 @@
[![.github/workflows/build-posix.yml](https://github.com/sterin/abc/actions/workflows/build-posix.yml/badge.svg)](https://github.com/sterin/abc/actions/workflows/build-posix.yml)
[![.github/workflows/build-windows.yml](https://github.com/sterin/abc/actions/workflows/build-windows.yml/badge.svg)](https://github.com/sterin/abc/actions/workflows/build-windows.yml)
[![.github/workflows/build-posix.yml](https://github.com/berkeley-abc/abc/actions/workflows/build-posix.yml/badge.svg)](https://github.com/berkeley-abc/abc/actions/workflows/build-posix.yml)
[![.github/workflows/build-windows.yml](https://github.com/berkeley-abc/abc/actions/workflows/build-windows.yml/badge.svg)](https://github.com/berkeley-abc/abc/actions/workflows/build-windows.yml)
[![.github/workflows/build-posix-cmake.yml](https://github.com/berkeley-abc/abc/actions/workflows/build-posix-cmake.yml/badge.svg)](https://github.com/berkeley-abc/abc/actions/workflows/build-posix-cmake.yml)
# ABC: System for Sequential Logic Synthesis and Formal Verification