build: use vcpkg for most dependencies on macos

This commit is contained in:
Bruno Alexandre Rosa 2025-09-21 20:37:52 -03:00
parent 217646f031
commit 97db6a3951
2 changed files with 38 additions and 11 deletions

View file

@ -236,6 +236,8 @@ jobs:
xcode: "14.3.1" xcode: "14.3.1"
type: Release type: Release
make_package: 1 make_package: 1
qt_version: 6.6.*
qt_modules: "qtimageformats qtmultimedia qtwebsockets"
- target: 14 - target: 14
soc: Apple soc: Apple
@ -243,6 +245,9 @@ jobs:
xcode: "15.4" xcode: "15.4"
type: Release type: Release
make_package: 1 make_package: 1
qt_version: 6.6.*
qt_arch: clang_64
qt_modules: "qtimageformats qtmultimedia qtwebsockets"
- target: 15 - target: 15
soc: Apple soc: Apple
@ -250,12 +255,18 @@ jobs:
xcode: "16.2" xcode: "16.2"
type: Release type: Release
make_package: 1 make_package: 1
qt_version: 6.6.*
qt_arch: clang_64
qt_modules: "qtimageformats qtmultimedia qtwebsockets"
- target: 15 - target: 15
soc: Apple soc: Apple
os: macos-15 os: macos-15
xcode: "16.2" xcode: "16.2"
type: Debug type: Debug
qt_version: 6.6.*
qt_arch: clang_64
qt_modules: "qtimageformats qtmultimedia qtwebsockets"
name: macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} name: macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }}
needs: configure needs: configure
@ -271,16 +282,30 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v5
with:
submodules: recursive
- name: Install dependencies using Homebrew - name: Setup Ccache
shell: bash uses: jianmingyong/ccache-action@v1
# CMake cannot find the MySQL connector with:
# Neither of these works: mariadb-connector-c mysql-connector-c++ install: true
env: install-type: "binary"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: | - name: Install Qt ${{matrix.qt_version}}
brew update uses: jurplel/install-qt-action@v4
brew install ccache protobuf qt --force-bottle with:
cache: true
setup-python: true
version: ${{matrix.qt_version}}
arch: ${{matrix.qt_arch}}
tools: ${{matrix.qt_tools}}
modules: ${{matrix.qt_modules}}
- name: Setup vcpkg cache
id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Restore compiler cache (ccache) - name: Restore compiler cache (ccache)
id: ccache_restore id: ccache_restore
@ -304,6 +329,8 @@ jobs:
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }} MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }} MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}' CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}'
VCPKG_DISABLE_METRICS: 1
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE" run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE"
- name: Save compiler cache (ccache) - name: Save compiler cache (ccache)

View file

@ -48,8 +48,8 @@ if(USE_CCACHE)
endif() endif()
endif() endif()
if(WIN32) if(WIN32 OR APPLE)
# Use vcpkg toolchain on Windows # Use vcpkg toolchain on Windows and macOS
set(CMAKE_TOOLCHAIN_FILE set(CMAKE_TOOLCHAIN_FILE
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file" CACHE STRING "Vcpkg toolchain file"