Skip to content

Commit 6d04b3f

Browse files
committed
WIP
1 parent 0a363ce commit 6d04b3f

File tree

2 files changed

+167
-6
lines changed

2 files changed

+167
-6
lines changed

.github/workflows/test-cmake.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,18 @@ jobs:
3030
with:
3131
submodules: recursive
3232

33+
- name: Cache IPlug SDKs
34+
id: cache-sdks
35+
uses: actions/cache@v4
36+
with:
37+
path: |
38+
iPlug2/Dependencies/IPlug/VST3_SDK
39+
iPlug2/Dependencies/IPlug/CLAP_SDK
40+
iPlug2/Dependencies/IPlug/CLAP_HELPERS
41+
key: iplug-sdks-${{ hashFiles('iPlug2/Dependencies/IPlug/download-iplug-sdks.sh') }}
42+
3343
- name: Get SDKs
44+
if: steps.cache-sdks.outputs.cache-hit != 'true'
3445
run: |
3546
cd iPlug2/Dependencies/IPlug
3647
./download-iplug-sdks.sh
@@ -67,7 +78,18 @@ jobs:
6778
with:
6879
submodules: recursive
6980

81+
- name: Cache IPlug SDKs
82+
id: cache-sdks
83+
uses: actions/cache@v4
84+
with:
85+
path: |
86+
iPlug2/Dependencies/IPlug/VST3_SDK
87+
iPlug2/Dependencies/IPlug/CLAP_SDK
88+
iPlug2/Dependencies/IPlug/CLAP_HELPERS
89+
key: iplug-sdks-${{ hashFiles('iPlug2/Dependencies/IPlug/download-iplug-sdks.sh') }}
90+
7091
- name: Get SDKs
92+
if: steps.cache-sdks.outputs.cache-hit != 'true'
7193
run: |
7294
cd iPlug2/Dependencies/IPlug
7395
./download-iplug-sdks.sh
@@ -108,7 +130,18 @@ jobs:
108130
- name: Install Ninja
109131
run: brew install ninja
110132

133+
- name: Cache IPlug SDKs
134+
id: cache-sdks
135+
uses: actions/cache@v4
136+
with:
137+
path: |
138+
iPlug2/Dependencies/IPlug/VST3_SDK
139+
iPlug2/Dependencies/IPlug/CLAP_SDK
140+
iPlug2/Dependencies/IPlug/CLAP_HELPERS
141+
key: iplug-sdks-${{ hashFiles('iPlug2/Dependencies/IPlug/download-iplug-sdks.sh') }}
142+
111143
- name: Get SDKs
144+
if: steps.cache-sdks.outputs.cache-hit != 'true'
112145
run: |
113146
cd iPlug2/Dependencies/IPlug
114147
./download-iplug-sdks.sh
@@ -129,6 +162,84 @@ jobs:
129162
test -d build-ninja/out/${{env.PROJECT_NAME}}.component
130163
echo "All bundles exist"
131164
165+
# ==========================================================================
166+
# macOS - IGraphics Backends Matrix
167+
# ==========================================================================
168+
macos-backends:
169+
name: macOS ${{ matrix.backend }}/${{ matrix.renderer }}
170+
runs-on: macos-latest
171+
strategy:
172+
fail-fast: false
173+
matrix:
174+
include:
175+
- backend: NANOVG
176+
renderer: GL3
177+
needs_skia: false
178+
- backend: SKIA
179+
renderer: METAL
180+
needs_skia: true
181+
- backend: SKIA
182+
renderer: GL3
183+
needs_skia: true
184+
- backend: SKIA
185+
renderer: CPU
186+
needs_skia: true
187+
steps:
188+
- name: Checkout
189+
uses: actions/checkout@v4
190+
with:
191+
submodules: recursive
192+
193+
- name: Install Ninja
194+
run: brew install ninja
195+
196+
- name: Cache IPlug SDKs
197+
id: cache-sdks
198+
uses: actions/cache@v4
199+
with:
200+
path: |
201+
iPlug2/Dependencies/IPlug/VST3_SDK
202+
iPlug2/Dependencies/IPlug/CLAP_SDK
203+
iPlug2/Dependencies/IPlug/CLAP_HELPERS
204+
key: iplug-sdks-${{ hashFiles('iPlug2/Dependencies/IPlug/download-iplug-sdks.sh') }}
205+
206+
- name: Get SDKs
207+
if: steps.cache-sdks.outputs.cache-hit != 'true'
208+
run: |
209+
cd iPlug2/Dependencies/IPlug
210+
./download-iplug-sdks.sh
211+
212+
- name: Cache Skia Prebuilt Libs
213+
if: matrix.needs_skia
214+
id: cache-skia
215+
uses: actions/cache@v4
216+
with:
217+
path: |
218+
iPlug2/Dependencies/Build/mac
219+
iPlug2/Dependencies/Build/src/skia
220+
key: skia-prebuilt-mac-${{ hashFiles('iPlug2/Dependencies/download-prebuilt-libs.sh') }}
221+
222+
- name: Get Skia Prebuilt Libs
223+
if: matrix.needs_skia && steps.cache-skia.outputs.cache-hit != 'true'
224+
run: |
225+
cd iPlug2/Dependencies
226+
./download-prebuilt-libs.sh mac
227+
228+
- name: CMake Generate
229+
run: |
230+
cmake -G Ninja -B build -S . \
231+
-DCMAKE_BUILD_TYPE=Release \
232+
-DIGRAPHICS_BACKEND=${{ matrix.backend }} \
233+
-DIGRAPHICS_RENDERER=${{ matrix.renderer }}
234+
235+
- name: Build
236+
run: ninja -C build ${{env.PROJECT_NAME}}-app
237+
238+
- name: Verify App Bundle
239+
run: |
240+
test -d build/out/${{env.PROJECT_NAME}}.app
241+
echo "${{ matrix.backend }}/${{ matrix.renderer }} build successful"
242+
132243
# ==========================================================================
133244
# macOS - Unix Makefiles Generator
134245
# ==========================================================================
@@ -141,7 +252,18 @@ jobs:
141252
with:
142253
submodules: recursive
143254

255+
- name: Cache IPlug SDKs
256+
id: cache-sdks
257+
uses: actions/cache@v4
258+
with:
259+
path: |
260+
iPlug2/Dependencies/IPlug/VST3_SDK
261+
iPlug2/Dependencies/IPlug/CLAP_SDK
262+
iPlug2/Dependencies/IPlug/CLAP_HELPERS
263+
key: iplug-sdks-${{ hashFiles('iPlug2/Dependencies/IPlug/download-iplug-sdks.sh') }}
264+
144265
- name: Get SDKs
266+
if: steps.cache-sdks.outputs.cache-hit != 'true'
145267
run: |
146268
cd iPlug2/Dependencies/IPlug
147269
./download-iplug-sdks.sh
@@ -174,7 +296,18 @@ jobs:
174296
with:
175297
submodules: recursive
176298

299+
- name: Cache IPlug SDKs
300+
id: cache-sdks
301+
uses: actions/cache@v4
302+
with:
303+
path: |
304+
iPlug2/Dependencies/IPlug/VST3_SDK
305+
iPlug2/Dependencies/IPlug/CLAP_SDK
306+
iPlug2/Dependencies/IPlug/CLAP_HELPERS
307+
key: iplug-sdks-${{ hashFiles('iPlug2/Dependencies/IPlug/download-iplug-sdks.sh') }}
308+
177309
- name: Get SDKs
310+
if: steps.cache-sdks.outputs.cache-hit != 'true'
178311
run: |
179312
cd iPlug2/Dependencies/IPlug
180313
./download-iplug-sdks.sh
@@ -294,7 +427,15 @@ jobs:
294427
run: |
295428
sed -i.bak s,"if not js_manipulation.isidentifier(settings.EXPORT_NAME):","if False:",g $EMSDK/upstream/emscripten/emcc.py
296429
430+
- name: Cache WAM SDK
431+
id: cache-wam
432+
uses: actions/cache@v4
433+
with:
434+
path: iPlug2/Dependencies/IPlug/WAM_SDK
435+
key: wam-sdk-${{ hashFiles('iPlug2/Dependencies/IPlug/download-iplug-sdks.sh') }}
436+
297437
- name: Get WAM SDK
438+
if: steps.cache-wam.outputs.cache-hit != 'true'
298439
run: |
299440
cd iPlug2/Dependencies/IPlug
300441
./download-iplug-sdks.sh

TemplateProject/CMakeLists.txt

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,37 @@ set(IPLUG2_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../iPlug2 CACHE PATH "iPlug2 root dir
66
include(${IPLUG2_DIR}/iPlug2.cmake)
77
find_package(iPlug2 REQUIRED)
88

9-
# IGraphics backend selection (NANOVG or SKIA)
10-
set(IGRAPHICS_BACKEND "NANOVG" CACHE STRING "IGraphics drawing backend (NANOVG or SKIA)")
9+
# IGraphics backend selection
10+
set(IGRAPHICS_BACKEND "NANOVG" CACHE STRING "IGraphics drawing backend")
1111
set_property(CACHE IGRAPHICS_BACKEND PROPERTY STRINGS "NANOVG" "SKIA")
1212

13-
# Set the IGraphics library based on backend selection
13+
# IGraphics renderer selection
14+
# NANOVG supports: GL2, GL3, METAL
15+
# SKIA supports: GL3, METAL, CPU
16+
set(IGRAPHICS_RENDERER "METAL" CACHE STRING "IGraphics renderer")
17+
set_property(CACHE IGRAPHICS_RENDERER PROPERTY STRINGS "GL2" "GL3" "METAL" "CPU")
18+
19+
# Construct the IGraphics library target based on selections
1420
if(IGRAPHICS_BACKEND STREQUAL "SKIA")
15-
set(IGRAPHICS_LIB iPlug2::IGraphics::Skia::Metal)
21+
if(IGRAPHICS_RENDERER STREQUAL "CPU")
22+
set(IGRAPHICS_LIB iPlug2::IGraphics::Skia::CPU)
23+
elseif(IGRAPHICS_RENDERER STREQUAL "GL3")
24+
set(IGRAPHICS_LIB iPlug2::IGraphics::Skia::GL3)
25+
else()
26+
set(IGRAPHICS_LIB iPlug2::IGraphics::Skia::Metal)
27+
endif()
1628
else()
17-
set(IGRAPHICS_LIB iPlug2::IGraphics::NanoVG::Metal)
29+
# NanoVG
30+
if(IGRAPHICS_RENDERER STREQUAL "GL3")
31+
set(IGRAPHICS_LIB iPlug2::IGraphics::NanoVG::GL3)
32+
elseif(IGRAPHICS_RENDERER STREQUAL "METAL")
33+
set(IGRAPHICS_LIB iPlug2::IGraphics::NanoVG::Metal)
34+
else()
35+
# Default to GL2 for NanoVG
36+
set(IGRAPHICS_LIB iPlug2::IGraphics::NanoVG)
37+
endif()
1838
endif()
19-
message(STATUS "IGraphics backend: ${IGRAPHICS_BACKEND} -> ${IGRAPHICS_LIB}")
39+
message(STATUS "IGraphics: ${IGRAPHICS_BACKEND}/${IGRAPHICS_RENDERER} -> ${IGRAPHICS_LIB}")
2040

2141
set(PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
2242
set(PLUG_RESOURCES_DIR ${PROJECT_DIR}/resources)

0 commit comments

Comments
 (0)