-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (34 loc) · 1.14 KB
/
cmake_install_macos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Test the installation on MacOS
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: macos-latest
steps:
- name: Install tools manually
run: brew install tbb
- name: Set environment variables
run: |
echo "CPLUS_INCLUDE_PATH=$(brew --prefix tbb)/include" >> $GITHUB_ENV
echo "LIBRARY_PATH=$(brew --prefix tbb)/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$(brew --prefix tbb)/lib" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Build and install
working-directory: ${{github.workspace}}
run: |
mkdir -p build && cd build
cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix tbb)
cmake --build .
sudo cmake --install .
- name: Test include
working-directory: ${{github.workspace}}
run: |
touch test.cpp
echo "#include <dsm/dsm.hpp>" >> test.cpp
echo "int main() {}" >> test.cpp
g++ test.cpp -std=c++20 -I$(brew --prefix tbb)/include -L$(brew --prefix tbb)/lib -ltbb \
&& echo "Compiled successfully" \
|| (echo "Cannot include dsm" ; exit 1)