build: target older macos

This commit is contained in:
Bruno Alexandre Rosa 2025-10-02 18:25:28 -03:00
parent 30e6b52783
commit f2645eb35d
3 changed files with 42 additions and 13 deletions

View file

@ -11,6 +11,7 @@
# --debug or --release sets the build type ie CMAKE_BUILD_TYPE
# --ccache [<size>] uses ccache and shows stats, optionally provide size
# --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
# (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
@ -75,6 +76,15 @@ while [[ $# != 0 ]]; do
BUILD_DIR="$1"
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"
exit 3
@ -116,6 +126,11 @@ fi
if [[ $PACKAGE_TYPE ]]; then
flags+=("-DCPACK_GENERATOR=$PACKAGE_TYPE")
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
buildflags=(--config "$BUILDTYPE")