RetroShare/.github/workflows/macos-cmake.yml
jolavillette f3e5f8541d refactor(cmake): rename "monorepo" -> super-project terminology
The root build is a modular super-project: libretroshare, retroshare-gui,
retroshare-service, retroshare-friendserver and plugins are each a standalone
CMake project that the top-level CMakeLists.txt only aggregates (and they live
in separate git repos pulled as submodules). Rename project(retroshare-monorepo)
-> project(retroshare-superproject) and reword the CI header comments. Purely
cosmetic: the old name was referenced nowhere.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 19:41:45 +02:00

91 lines
3.4 KiB
YAML

# macOS CMake CI for the RetroShare super-project (root aggregate build).
#
# CMake counterpart of the legacy qmake ci-macOS.yml. Unlike that one (which
# disables service/friendserver/sam3/rnp), this builds the WHOLE tree with the
# same feature set as the Linux CMake CI, using the user's validated local macOS
# command (Homebrew -I/-L flag harvesting).
#
# Submodules are initialised WITHOUT --remote (identical to ubuntu-cmake.yml) so
# libretroshare stays on its pinned, CMake-enabled commit.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
name: macOS CMake C/C++ CI
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: macOS 14 / Qt5 / CMake
runs-on: macos-14
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
# Same pinned-commit init as the Ubuntu CMake CI (no --remote); librnp needs
# --recursive for its nested src/libsexpp.
- name: Init submodules (pinned commits)
run: |
git submodule update --init \
libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/
git submodule update --init --recursive \
supportlibs/librnp
git submodule update --init \
supportlibs/restbed supportlibs/libsam3 \
supportlibs/udp-discovery-cpp supportlibs/rapidjson
git --no-pager -C libretroshare log --max-count 1 --oneline
- name: Install Homebrew dependencies
run: >
brew install
ninja qt@5 openssl@3 botan@2 sqlcipher miniupnpc
json-c asio speex speexdsp ffmpeg
libxml2 libxslt bzip2 zlib rapidjson doxygen
# Mirrors the validated local macOS command: harvest every Homebrew opt/*
# include/lib dir into the compiler/linker flags, and additionally expose them
# to find_package() via CMAKE_PREFIX_PATH (needed for keg-only qt@5, botan@2…).
- name: CMake configure
run: |
HB="$(brew --prefix)"
QT5="$(brew --prefix qt@5)"
IFLAGS="-I$HB/include"; for d in "$HB"/opt/*/include; do IFLAGS="$IFLAGS -I$d"; done
LFLAGS="-L$HB/lib"; for d in "$HB"/opt/*/lib; do LFLAGS="$LFLAGS -L$d"; done
# qt@5 first so find_package(Qt5) picks the keg-only (correct) config, not a
# broken Qt5 config that may sit directly under the Homebrew prefix.
PREFIX="$QT5;$HB"; for d in "$HB"/opt/*; do PREFIX="$PREFIX;$d"; done
cmake -G Ninja -B Build-cmake -S . \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DQt5_DIR="$QT5/lib/cmake/Qt5" \
-DOPENSSL_ROOT_DIR="$(brew --prefix openssl@3)" \
-DRS_RNPLIB=ON -DRS_JSON_API=ON -DRS_WEBUI=ON \
-DRS_GUI=ON -DRS_SERVICE=ON -DRS_FRIENDSERVER=ON -DRS_PLUGINS=ON -DRS_FORUM_DEEP_INDEX=OFF \
-DRS_USE_I2P_SAM3=ON -DRS_BITDHT=ON -DRS_MINIUPNPC=ON \
-DRS_BRODCAST_DISCOVERY=ON -DRS_SQLCIPHER=ON \
-DCMAKE_C_FLAGS="$IFLAGS" -DCMAKE_CXX_FLAGS="$IFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="$LFLAGS" \
-DCMAKE_SHARED_LINKER_FLAGS="$LFLAGS" \
-DCMAKE_MODULE_LINKER_FLAGS="$LFLAGS"
- name: CMake build
run: cmake --build Build-cmake -j$(sysctl -n hw.ncpu)