export omp flags #83
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 unit | |
# adapted from: https://github.com/trase-cpp/trase/tree/master/.github/workflows | |
on: | |
push: | |
branches: | |
# - main | |
- develop | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build-and-test: | |
name: macOS unit | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libomp without linking | |
run: | | |
brew reinstall libomp | |
echo "LDFLAGS=-L/opt/homebrew/opt/libomp/lib" >> $GITHUB_ENV | |
echo "CPPFLAGS=-I/opt/homebrew/opt/libomp/include" >> $GITHUB_ENV | |
- name: Make build directory | |
run: mkdir build_dir | |
- name: CMake configure | |
run: | | |
export LDFLAGS=-L/opt/homebrew/opt/libomp/lib | |
export CPPFLAGS=-I/opt/homebrew/opt/libomp/include | |
cmake .. -DCMAKE_BUILD_TYPE=Debug -DDTWC_BUILD_TESTING=ON | |
working-directory: build_dir | |
- name: CMake build | |
run: | | |
export LDFLAGS=-L/opt/homebrew/opt/libomp/lib | |
export CPPFLAGS=-I/opt/homebrew/opt/libomp/include | |
cmake --build . --parallel 2 | |
working-directory: build_dir | |
- name: CMake test | |
run: | | |
export LDFLAGS=-L/opt/homebrew/opt/libomp/lib | |
export CPPFLAGS=-I/opt/homebrew/opt/libomp/include | |
ctest -j2 -C Debug --output-on-failure | |
working-directory: build_dir |