Travis: add iOS target built with CMake (#378)

Issue #377 suggested that CMake builds for iOS with c-ares were broken. This PR adds an automatic Travis build for iOS CMake.

Fix By: Brad House (@bradh352)
pull/382/head cares-1_17_1
Brad House 4 years ago committed by GitHub
parent 212363df90
commit 39c73b503d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      .travis.yml
  2. 16
      travis/build.sh
  3. 2
      travis/test.sh

@ -58,6 +58,11 @@ matrix:
compiler: clang
language: objective-c
env: BUILD_TYPE=ios
- os: osx
osx_image: xcode11.4
compiler: clang
language: objective-c
env: BUILD_TYPE=ios-cmake
install:
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then pip install --user cpp-coveralls > /dev/null; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew reinstall libtool > /dev/null; fi
@ -107,6 +112,15 @@ before_script:
export CXXFLAGS=$IOSFLAGS
export LDFLAGS=$IOSFLAGS
fi
- |
if [ "$BUILD_TYPE" = "ios-cmake" ]; then
export SYSROOT="$(xcode-select -print-path)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/"
export IOSFLAGS="-miphoneos-version-min=10.0"
export ARCHITECTURES="armv7;armv7s;arm64"
export CFLAGS=$IOSFLAGS
export CXXFLAGS=$IOSFLAGS
export LDFLAGS=$IOSFLAGS
fi
script:
- ./travis/build.sh && ./travis/test.sh
- if [ "$BUILD_TYPE" = "normal" ]; then ./travis/distcheck.sh ; fi

@ -1,12 +1,26 @@
#!/bin/sh
set -e
if [ "$BUILD_TYPE" != "cmake" -a "$BUILD_TYPE" != "valgrind" ]; then
if [ "$BUILD_TYPE" != "cmake" -a "$BUILD_TYPE" != "valgrind" -a "$BUILD_TYPE" != "ios-cmake" ]; then
./buildconf
mkdir atoolsbld
cd atoolsbld
$SCAN_WRAP ../configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug $CONFIG_OPTS
$SCAN_WRAP make
elif [ "$BUILD_TYPE" = "ios-cmake" ] ; then
mkdir cmakebld
cd cmakebld
cmake \
-DCMAKE_BUILD_TYPE=DEBUG \
-DCARES_STATIC=ON \
-DCARES_STATIC_PIC=ON \
-DCARES_BUILD_TESTS=OFF \
-DCMAKE_C_FLAGS=$CFLAGS \
-DCMAKE_CXX_FLAGS=$CXXFLAGS \
-DCMAKE_OSX_SYSROOT=$SYSROOT \
-DCMAKE_OSX_ARCHITECTURES=$ARCHITECTURES \
..
make
else
# Use cmake for valgrind to prevent libtool script wrapping of tests that interfere with valgrind
mkdir cmakebld

@ -6,7 +6,7 @@ set -e
[ -z "$TEST_FILTER" ] && export TEST_FILTER="--gtest_filter=-*LiveSearchANY*"
# No tests for ios as it is a cross-compile
if [ "$BUILD_TYPE" = "ios" ] ; then
if [ "$BUILD_TYPE" = "ios" -o "$BUILD_TYPE" = "ios-cmake" ] ; then
exit 0
fi

Loading…
Cancel
Save