Skip to content

Commit

Permalink
cmake bs
Browse files Browse the repository at this point in the history
  • Loading branch information
danpf committed Nov 15, 2023
1 parent 8552349 commit c2591a3
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ jobs:
cxx: g++
shell: bash
- os: ubuntu-18.04
env: ARCH=x86
cc: gcc-4.8
cxx: g++-4.8
shell: bash
env_list: ARCH=x86
- os: ubuntu-22.04
env: EMSCRIPTEN=ON
cc: gcc
cxx: g++
shell: bash
env_list: EMSCRIPTEN=ON
- os: ubuntu-22.04
cc: clang
cxx: clang++
shell: bash
- os: ubuntu-22.04
env: CMAKE_EXTRA="-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-march=native'"
cc: gcc
cxx: g++
shell: bash
cmake_args: "-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-march=native'"
- os: macos-latest
cc: clang
cxx: clang++
Expand All @@ -49,13 +49,29 @@ jobs:
defaults:
run:
shell: ${{ matrix.shell }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
ARCH: ${{ matrix.arch }}
CMAKE_ARGS: ${{ matrix.cmake_args }}

steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Set environment list variables
run: |
env_vars="${{ matrix.env_list }}"
for var in $env_vars; do
echo "$var" >> $GITHUB_ENV
done
- name: Set CMAKE_GENERATOR for Windows
if: matrix.os == 'windows-latest'
run: echo "CMAKE_GENERATOR=MinGW Makefiles" >> $GITHUB_ENV

- name: install mingw & deps
uses: msys2/setup-msys2@v2
with:
Expand All @@ -66,7 +82,7 @@ jobs:

- name: Install Dependencies
run: |
if [ "${{ matrix.env }}" = "ARCH=x86" ]; then
if [[ "${{ matrix.env_list }}" = "ARCH=x86" ]]; then
sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8 g++-4.8-multilib linux-libc-dev:i386 libc6-dev-i386
fi
Expand All @@ -80,9 +96,7 @@ jobs:
- name: build and test
run: |
mkdir build && cd build
export CC=${{matrix.cc}}
export CXX=${{matrix.cxx}}
${{matrix.env}} cmake -Dmmtf_build_examples=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=debug ..
cmake $CMAKE_ARGS -Dmmtf_build_examples=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=debug ..
make -j2
echo "lol"
ls
Expand Down

0 comments on commit c2591a3

Please sign in to comment.