chore: Add macOS build.

This commit is contained in:
iphydf 2021-12-28 23:25:34 +00:00
parent d8397c93c8
commit 8ce2ae0fcb
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
3 changed files with 32 additions and 36 deletions

View File

@ -13,6 +13,7 @@ branches:
required_status_checks: required_status_checks:
contexts: contexts:
- build-bootstrapd-docker - build-bootstrapd-docker
- build-macos
- build-nacl - build-nacl
- build-win32 - build-win32
- build-win64 - build-win64

View File

@ -44,3 +44,10 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Build on FreeBSD - name: Build on FreeBSD
run: .travis/cmake-freebsd-stage2 run: .travis/cmake-freebsd-stage2
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build and test
run: .travis/cmake-osx

View File

@ -1,49 +1,37 @@
#!/bin/bash #!/bin/bash
ACTION="$1"
set -eu set -eu
CACHEDIR="$HOME/cache" CACHEDIR="$HOME/cache"
NPROC=$(sysctl -n hw.physicalcpu) NPROC=$(sysctl -n hw.physicalcpu)
travis_install() { # Workaround for bug in Homebrew where it only finds an old Ruby version.
# Workaround for bug in Homebrew where it only finds an old Ruby version. brew update
brew update
brew install libsodium libvpx opus libconfig brew install libconfig libsodium libvpx opus
}
travis_script() { . ".travis/flags-clang.sh"
. ".travis/flags-$CC.sh"
add_ld_flag -undefined error add_ld_flag -undefined error
# Make compilation error on a warning # Make compilation error on a warning
add_flag -Werror add_flag -Werror
cmake -B_build -H. \ cmake -B_build -H. \
-DCMAKE_C_FLAGS="$C_FLAGS" \ -DCMAKE_C_FLAGS="$C_FLAGS" \
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \ -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \ -DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
-DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \ -DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
-DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \ -DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \
-DMIN_LOGGER_LEVEL=TRACE \ -DMIN_LOGGER_LEVEL=TRACE \
-DMUST_BUILD_TOXAV=ON \ -DMUST_BUILD_TOXAV=ON \
-DNON_HERMETIC_TESTS=ON \ -DNON_HERMETIC_TESTS=ON \
-DTEST_TIMEOUT_SECONDS=120 \ -DTEST_TIMEOUT_SECONDS=120 \
-DUSE_IPV6=OFF \ -DUSE_IPV6=OFF \
-DAUTOTEST=ON -DAUTOTEST=ON
cd _build # pushd cd _build # pushd
make "-j$NPROC" -k install make "-j$NPROC" -k install
make "-j$NPROC" test ARGS="-j50" || make "-j$NPROC" test ARGS="-j50" ||
make "-j$NPROC" test ARGS="-j50 --rerun-failed" CTEST_OUTPUT_ON_FAILURE=1 make "-j$NPROC" test ARGS="-j50 --rerun-failed" CTEST_OUTPUT_ON_FAILURE=1
cd - # popd cd - # popd
}
if [ "-z" "$ACTION" ]; then
"travis_script"
else
"travis_$ACTION"
fi