Skip to content

Commit 1b4e318

Browse files
committed
feat(juce): let JUCE projects add the module through FetchContent
The top-level CMakeLists always looked up OpenSSL, and CURL unless MOONBASE_USE_CURL was off, although the JUCE module needs neither. A JUCE project therefore could not FetchContent_MakeAvailable() this repository on a machine without them, and had to fetch the sources and call juce_add_module() itself. MOONBASE_JUCE_MODULE_ONLY (off by default) adds just the moonbase_licensing module with JUCE's juce_add_module and leaves out the core SDK target and everything built on it, so OpenSSL, CURL and nlohmann_json are never looked up. JUCE has to be added first; the configure says so if it was not. The JUCE workflow now configures with the option, and a new job builds tests/juce_consumer_smoke, a JUCE project consuming the repository this way, with the OpenSSL and CURL lookups disabled outright.
1 parent ddeebc5 commit 1b4e318

11 files changed

Lines changed: 307 additions & 167 deletions

File tree

‎.github/workflows/juce.yml‎

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ name: JUCE module
77
#
88
# The suite signs tokens with OpenSSL then verifies them with the platform's
99
# native backend, i.e. a real cross-backend RS256 round-trip on each OS. The
10-
# module needs no curl, so the build turns it off (-DMOONBASE_USE_CURL=OFF).
10+
# suite needs nothing from the core SDK target, so the build configures with
11+
# -DMOONBASE_JUCE_MODULE_ONLY=ON, which also skips its CURL lookup. OpenSSL is
12+
# still installed because the suite signs its test tokens with it.
1113
#
1214
# The module supports JUCE 6.1.3 and up, so the matrix also builds the two older
1315
# lines: 6.1.3 is what HISE pins, 7.0.12 is the last 7.x. They run on macOS only.
@@ -70,7 +72,7 @@ jobs:
7072
run: |
7173
cmake -S . -B build \
7274
-DCMAKE_BUILD_TYPE=Release \
73-
-DMOONBASE_USE_CURL=OFF \
75+
-DMOONBASE_JUCE_MODULE_ONLY=ON \
7476
-DMOONBASE_BUILD_JUCE_TESTS=ON \
7577
-DMOONBASE_JUCE_VERSION="${{ matrix.juce }}"
7678
@@ -79,7 +81,7 @@ jobs:
7981
run: |
8082
cmake -S . -B build \
8183
-DCMAKE_BUILD_TYPE=Release \
82-
-DMOONBASE_USE_CURL=OFF \
84+
-DMOONBASE_JUCE_MODULE_ONLY=ON \
8385
-DMOONBASE_BUILD_JUCE_TESTS=ON \
8486
-DMOONBASE_JUCE_VERSION="${{ matrix.juce }}" \
8587
-DOPENSSL_ROOT_DIR="$(brew --prefix openssl@3)"
@@ -89,7 +91,7 @@ jobs:
8991
shell: bash
9092
run: |
9193
cmake -S . -B build \
92-
-DMOONBASE_USE_CURL=OFF \
94+
-DMOONBASE_JUCE_MODULE_ONLY=ON \
9395
-DMOONBASE_BUILD_JUCE_TESTS=ON \
9496
-DMOONBASE_JUCE_VERSION="${{ matrix.juce }}" \
9597
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \
@@ -113,3 +115,26 @@ jobs:
113115
- name: Test
114116
if: runner.os != 'Linux'
115117
run: ctest --test-dir build -R "Juce\." -C Release --output-on-failure
118+
119+
# The route a JUCE project takes to consume this repository: JUCE first, then
120+
# the repository as a subproject with MOONBASE_JUCE_MODULE_ONLY on. OpenSSL and
121+
# CURL lookups are disabled outright, so a REQUIRED lookup creeping back onto
122+
# that path fails the configure. One OS is enough: the regression is a CMake
123+
# one, and the module's compile is covered on every OS above.
124+
module-only-consumer:
125+
name: module-only consumer (macos-14)
126+
runs-on: macos-14
127+
timeout-minutes: 30
128+
129+
steps:
130+
- uses: actions/checkout@v4
131+
132+
- name: Configure
133+
run: |
134+
cmake -S tests/juce_consumer_smoke -B build-juce-consumer \
135+
-DCMAKE_BUILD_TYPE=Release \
136+
-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON \
137+
-DCMAKE_DISABLE_FIND_PACKAGE_CURL=ON
138+
139+
- name: Build
140+
run: cmake --build build-juce-consumer --target MoonbaseJuceConsumerSmoke --config Release -j

‎.releaserc.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"CMakeLists.txt",
2424
"README.md",
2525
"docs/core-sdk.md",
26+
"docs/juce-module.md",
2627
"modules/moonbase_licensing/moonbase_licensing.h"
2728
],
2829
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"

0 commit comments

Comments
 (0)