mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-21 22:33:54 -07:00
build: target older macos
This commit is contained in:
parent
30e6b52783
commit
f2645eb35d
3 changed files with 42 additions and 13 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
# --debug or --release sets the build type ie CMAKE_BUILD_TYPE
|
# --debug or --release sets the build type ie CMAKE_BUILD_TYPE
|
||||||
# --ccache [<size>] uses ccache and shows stats, optionally provide size
|
# --ccache [<size>] uses ccache and shows stats, optionally provide size
|
||||||
# --dir <dir> sets the name of the build dir, default is "build"
|
# --dir <dir> sets the name of the build dir, default is "build"
|
||||||
|
# --x86-macos
|
||||||
# uses env: BUILDTYPE MAKE_INSTALL MAKE_PACKAGE PACKAGE_TYPE PACKAGE_SUFFIX MAKE_SERVER MAKE_TEST USE_CCACHE CCACHE_SIZE BUILD_DIR CMAKE_GENERATOR
|
# uses env: BUILDTYPE MAKE_INSTALL MAKE_PACKAGE PACKAGE_TYPE PACKAGE_SUFFIX MAKE_SERVER MAKE_TEST USE_CCACHE CCACHE_SIZE BUILD_DIR CMAKE_GENERATOR
|
||||||
# (correspond to args: --debug/--release --install --package <package type> --suffix <suffix> --server --test --ccache <ccache_size> --dir <dir>)
|
# (correspond to args: --debug/--release --install --package <package type> --suffix <suffix> --server --test --ccache <ccache_size> --dir <dir>)
|
||||||
# exitcode: 1 for failure, 3 for invalid arguments
|
# exitcode: 1 for failure, 3 for invalid arguments
|
||||||
|
|
@ -75,6 +76,15 @@ while [[ $# != 0 ]]; do
|
||||||
BUILD_DIR="$1"
|
BUILD_DIR="$1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
'--x86-macos')
|
||||||
|
shift
|
||||||
|
if [[ $# == 0 ]]; then
|
||||||
|
echo "::error file=$0::--x86-macos expects an argument"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
x86_MACOS="$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "::error file=$0::unrecognized option: $1"
|
echo "::error file=$0::unrecognized option: $1"
|
||||||
exit 3
|
exit 3
|
||||||
|
|
@ -116,6 +126,11 @@ fi
|
||||||
if [[ $PACKAGE_TYPE ]]; then
|
if [[ $PACKAGE_TYPE ]]; then
|
||||||
flags+=("-DCPACK_GENERATOR=$PACKAGE_TYPE")
|
flags+=("-DCPACK_GENERATOR=$PACKAGE_TYPE")
|
||||||
fi
|
fi
|
||||||
|
if [[ $x86_MACOS == true ]]; then
|
||||||
|
flags+=("-DCMAKE_OSX_DEPLOYMENT_TARGET=13.0")
|
||||||
|
flags+=("-DVCPKG_TARGET_TRIPLET=x64-osx-13")
|
||||||
|
flags+=("-DVCPKG_OVERLAY_TRIPLETS=../cmake/triplets")
|
||||||
|
fi
|
||||||
|
|
||||||
# Add cmake --build flags
|
# Add cmake --build flags
|
||||||
buildflags=(--config "$BUILDTYPE")
|
buildflags=(--config "$BUILDTYPE")
|
||||||
|
|
|
||||||
28
.github/workflows/desktop-build.yml
vendored
28
.github/workflows/desktop-build.yml
vendored
|
|
@ -232,8 +232,8 @@ jobs:
|
||||||
include:
|
include:
|
||||||
- target: 13
|
- target: 13
|
||||||
soc: Intel
|
soc: Intel
|
||||||
os: macos-13
|
os: macos-15-intel
|
||||||
xcode: "14.3.1"
|
xcode: "16.4"
|
||||||
type: Release
|
type: Release
|
||||||
make_package: 1
|
make_package: 1
|
||||||
|
|
||||||
|
|
@ -272,6 +272,15 @@ jobs:
|
||||||
DEVELOPER_DIR:
|
DEVELOPER_DIR:
|
||||||
/Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer
|
/Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer
|
||||||
CMAKE_GENERATOR: 'Ninja'
|
CMAKE_GENERATOR: 'Ninja'
|
||||||
|
BUILDTYPE: '${{matrix.type}}'
|
||||||
|
MAKE_PACKAGE: '${{matrix.make_package}}'
|
||||||
|
PACKAGE_SUFFIX: '-macOS${{matrix.target}}_${{matrix.soc}}'
|
||||||
|
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
|
||||||
|
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
|
||||||
|
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
|
||||||
|
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
|
||||||
|
VCPKG_DISABLE_METRICS: 1
|
||||||
|
VCPKG_BUILD_TYPE: 'release'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -293,7 +302,7 @@ jobs:
|
||||||
- name: Install Qt ${{env.QT_VERSION}}
|
- name: Install Qt ${{env.QT_VERSION}}
|
||||||
uses: jurplel/install-qt-action@v4
|
uses: jurplel/install-qt-action@v4
|
||||||
with:
|
with:
|
||||||
cache: false # qt caches take too much space for macOS (1.1Gi)
|
cache: true # qt caches take too much space for macOS (1.1Gi)
|
||||||
version: ${{env.QT_VERSION}}
|
version: ${{env.QT_VERSION}}
|
||||||
arch: ${{env.QT_ARCH}}
|
arch: ${{env.QT_ARCH}}
|
||||||
modules: ${{env.QT_MODULES}}
|
modules: ${{env.QT_MODULES}}
|
||||||
|
|
@ -308,17 +317,9 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
id: build
|
id: build
|
||||||
env:
|
env:
|
||||||
BUILDTYPE: '${{matrix.type}}'
|
|
||||||
MAKE_PACKAGE: '${{matrix.make_package}}'
|
|
||||||
PACKAGE_SUFFIX: '-macOS${{matrix.target}}_${{matrix.soc}}'
|
|
||||||
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
|
|
||||||
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
|
|
||||||
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
|
|
||||||
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
|
|
||||||
CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}'
|
|
||||||
VCPKG_DISABLE_METRICS: 1
|
|
||||||
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
||||||
run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE"
|
VCPKG_OSX_DEPLOYMENT_TARGET: ${{ matrix.soc == 'Intel' && '13.0' || '' }}
|
||||||
|
run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE" --x86-macos ${{ matrix.soc == 'Intel' }}
|
||||||
|
|
||||||
- name: Sign app bundle
|
- name: Sign app bundle
|
||||||
if: matrix.make_package && (github.ref == 'refs/heads/master' || needs.configure.outputs.tag != null)
|
if: matrix.make_package && (github.ref == 'refs/heads/master' || needs.configure.outputs.tag != null)
|
||||||
|
|
@ -455,6 +456,7 @@ jobs:
|
||||||
CMAKE_GENERATOR_PLATFORM: 'x64'
|
CMAKE_GENERATOR_PLATFORM: 'x64'
|
||||||
QTDIR: '${{github.workspace}}\Qt\${{matrix.qt_version}}\win64_${{matrix.qt_arch}}'
|
QTDIR: '${{github.workspace}}\Qt\${{matrix.qt_version}}\win64_${{matrix.qt_arch}}'
|
||||||
VCPKG_DISABLE_METRICS: 1
|
VCPKG_DISABLE_METRICS: 1
|
||||||
|
VCPKG_BUILD_TYPE: 'release'
|
||||||
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
||||||
# No need for --parallel flag, MTT is added in the compile script to let cmake/msbuild manage core count,
|
# No need for --parallel flag, MTT is added in the compile script to let cmake/msbuild manage core count,
|
||||||
# project and process parallelism: https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
|
# project and process parallelism: https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
|
||||||
|
|
|
||||||
12
cmake/triplets/x64-osx-13.cmake
Normal file
12
cmake/triplets/x64-osx-13.cmake
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# copied from vcpkg/triplets/x64-osx.cmake
|
||||||
|
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||||
|
set(VCPKG_CRT_LINKAGE dynamic)
|
||||||
|
set(VCPKG_LIBRARY_LINKAGE static)
|
||||||
|
|
||||||
|
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
||||||
|
set(VCPKG_OSX_ARCHITECTURES x86_64)
|
||||||
|
# end of copied code
|
||||||
|
|
||||||
|
# Set the minimum macOS version for all dependencies
|
||||||
|
set(VCPKG_CMAKE_SYSTEM_VERSION 13.0)
|
||||||
|
set(VCPKG_OSX_DEPLOYMENT_TARGET 13.0)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue