-
-
Notifications
You must be signed in to change notification settings - Fork 12
185 lines (160 loc) · 6.58 KB
/
build_cmake.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: CMake build
on: push
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows",
os: windows-latest,
path: "/c/ossia-sdk/llvm/bin",
common_flags: "-GNinja \
-DCMAKE_C_COMPILER=c:/ossia-sdk/llvm/bin/clang.exe \
-DCMAKE_CXX_COMPILER=c:/ossia-sdk/llvm/bin/clang++.exe \
-DCMAKE_EXE_LINKER_FLAGS=\"-fuse-ld=c:/ossia-sdk/llvm/bin/ld.lld.exe --target=x86_64-windows-gnu\" \
-DCMAKE_SHARED_LINKER_FLAGS=\"-fuse-ld=c:/ossia-sdk/llvm/bin/ld.lld.exe --target=x86_64-windows-gnu\" \
-DCMAKE_MODULE_LINKER_FLAGS=\"-fuse-ld=c:/ossia-sdk/llvm/bin/ld.lld.exe --target=x86_64-windows-gnu\" ",
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
release_flags: "-DCMAKE_BUILD_TYPE=Release",
build_flags: "",
dependencies: "choco install -y ninja",
sdk: "/c/ossia-sdk",
pre_build: ""
}
- {
name: "Ubuntu (clang)",
os: ubuntu-24.04,
path: "/opt/ossia-sdk/llvm/bin",
common_flags: "-DCMAKE_C_COMPILER=/usr/bin/clang-18 \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-18 \
-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \
-DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld \
-DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld",
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
release_flags: "-DCMAKE_BUILD_TYPE=Release",
build_flags: "",
dependencies: "sudo apt update ; \
sudo apt install lsb-release wget software-properties-common ; \
curl -L https://apt.llvm.org/llvm.sh > llvm.sh ; \
chmod +x ./llvm.sh ; \
sudo ./llvm.sh ; \
sudo apt update ; \
sudo apt install ninja-build clang-18 lld-18 libc++-18-dev libc++1-18 libc++abi1-18 libc++abi-18-dev",
sdk: "/opt/ossia-sdk",
pre_build: ""
}
- {
name: "Ubuntu (GCC)",
os: ubuntu-24.04,
common_flags: "-DCMAKE_C_COMPILER=/usr/bin/gcc-14 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-14",
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
release_flags: "-DCMAKE_BUILD_TYPE=Release",
build_flags: "",
dependencies: "sudo apt update ; \
sudo apt install lsb-release wget software-properties-common ; \
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa ; \
sudo apt update ; \
sudo apt install ninja-build gcc-14 g++-14",
sdk: "/opt/ossia-sdk",
pre_build: ""
}
- {
name: "macOS",
os: macos-13,
common_flags: "",
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
release_flags: "-DCMAKE_BUILD_TYPE=Release",
build_flags: "",
sdk: "/opt/ossia-sdk-x86_64",
pre_build: "sudo xcode-select -s /Applications/Xcode_15.0.app"
}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout dependencies
uses: actions/checkout@v3
with:
repository: ossia/score
submodules: "recursive"
path: score
- name: Checkout Max SDK
uses: actions/checkout@v3
with:
repository: jcelerier/max-sdk-base
submodules: "recursive"
path: max-sdk-base
- name: Install dependencies
shell: bash
run: |
${{ matrix.config.dependencies }}
- name: Download SDK
shell: bash
run: |
curl -L https://raw.githubusercontent.com/ossia/score/master/tools/fetch-sdk.sh > fetch-sdk.sh
chmod +x ./fetch-sdk.sh
./fetch-sdk.sh
- name: Build debug
shell: bash
run: |
mkdir build-debug
cd build-debug
if [[ "${{ matrix.config.path }}" != "" ]]; then
export PATH=${{ matrix.config.path }}:$PATH
fi
export MAX_SDK=$PWD/../max-sdk-base
export SDK_3RDPARTY=$PWD/../score/3rdparty
export VERBOSE=1
${{ matrix.config.pre_build }}
cmake .. \
-DBUILD_TESTING=1 \
-DBOOST_ROOT=${{ matrix.config.sdk }}/boost \
-Dpybind11_DIR=$SDK_3RDPARTY/libossia/3rdparty/pybind11 \
-DAVND_MAXSDK_PATH=$MAX_SDK \
-DVST3_SDK_ROOT=$SDK_3RDPARTY/vst3 \
-DCMAKE_PREFIX_PATH="$SDK_3RDPARTY/libpd/pure-data/src" \
${{ matrix.config.common_flags }} \
${{ matrix.config.debug_flags }}
cmake --build . -- ${{ matrix.config.build_flags }}
- name: Test debug
shell: bash
run: |
cd build-debug
if [[ "${{ matrix.config.path }}" != "" ]]; then
export PATH=${{ matrix.config.path }}:$PATH
fi
cmake --build . --target test
- name: Build release
shell: bash
run: |
mkdir build-release
cd build-release
if [[ "${{ matrix.config.path }}" != "" ]]; then
export PATH=${{ matrix.config.path }}:$PATH
fi
export MAX_SDK=$PWD/../max-sdk-base
export SDK_3RDPARTY=$PWD/../score/3rdparty
export VERBOSE=1
${{ matrix.config.pre_build }}
cmake .. \
-DBUILD_TESTING=1 \
-DBOOST_ROOT=${{ matrix.config.sdk }}/boost \
-Dpybind11_DIR=$SDK_3RDPARTY/libossia/3rdparty/pybind11 \
-DAVND_MAXSDK_PATH=$MAX_SDK \
-DVST3_SDK_ROOT=$SDK_3RDPARTY/vst3 \
-DCMAKE_PREFIX_PATH="$SDK_3RDPARTY/libpd/pure-data/src;$SDK_3RDPARTY/libossia/3rdparty/pybind11" \
${{ matrix.config.common_flags }} \
${{ matrix.config.release_flags }}
cmake --build . -- ${{ matrix.config.build_flags }}
- name: Test release
shell: bash
run: |
cd build-release
if [[ "${{ matrix.config.path }}" != "" ]]; then
export PATH=${{ matrix.config.path }}:$PATH
fi
cmake --build . --target test