Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macOS universal library build support #5

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
strategy:
matrix:
os: [windows-2022, macos-12, ubuntu-22.04]
os: [windows-2022, macos-15, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Homebrew Packages
Expand All @@ -21,7 +21,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get -y install autoconf automake autopoint gettext
- uses: secondlife/action-autobuild@v4
- uses: secondlife/action-autobuild@v5
release:
needs: build
runs-on: [ubuntu-latest]
Expand Down
41 changes: 27 additions & 14 deletions build-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pushd "$HUNSPELL_SOURCE_DIR"
mkdir -p "$stage/lib/release"

if [ "$AUTOBUILD_ADDRSIZE" = 32 ]
then
then
debbitdir=msvc/Debug/libhunspell
relbitdir=msvc/Release/libhunspell
else
Expand All @@ -77,18 +77,31 @@ pushd "$HUNSPELL_SOURCE_DIR"
# force regenerate autoconf
autoreconf -fvi

mkdir -p "build_release"
pushd "build_release"
CFLAGS="$plainopts" CXXFLAGS="$opts" \
../configure --prefix="$stage" --libdir="$stage/lib/release" --enable-static --disable-shared
make -j$AUTOBUILD_CPU_COUNT
make install

# conditionally run unit tests
if [ "${DISABLE_UNIT_TESTS:-0}" = "0" ]; then
make check
fi
popd
export MACOSX_DEPLOYMENT_TARGET="$LL_BUILD_DARWIN_DEPLOY_TARGET"

for arch in x86_64 arm64 ; do
ARCH_ARGS="-arch $arch"
opts="${TARGET_OPTS:-$ARCH_ARGS $LL_BUILD_RELEASE}"
cc_opts="$(remove_cxxstd $opts)"
ld_opts="$ARCH_ARGS"

mkdir -p "build_$arch"
pushd "build_$arch"
CFLAGS="$cc_opts" \
CXXFLAGS="$opts" \
LDFLAGS="$ld_opts" \
../configure --prefix="$stage" --libdir="$stage/lib/release/$arch" --enable-static --disable-shared --host=$arch-apple-darwin
make -j$AUTOBUILD_CPU_COUNT
make install

# conditionally run unit tests
if [ "${DISABLE_UNIT_TESTS:-0}" = "0" ]; then
make check -j$AUTOBUILD_CPU_COUNT
fi
popd
done

lipo -create -output ${stage}/lib/release/libhunspell-1.7.a ${stage}/lib/release/x86_64/libhunspell-1.7.a ${stage}/lib/release/arm64/libhunspell-1.7.a
;;
linux*)
# Default target per --address-size
Expand All @@ -107,7 +120,7 @@ pushd "$HUNSPELL_SOURCE_DIR"

# conditionally run unit tests
if [ "${DISABLE_UNIT_TESTS:-0}" = "0" ]; then
make check
make check -j$AUTOBUILD_CPU_COUNT
fi
popd
;;
Expand Down
Loading