Add macOS to travis

This commit is contained in:
wangqr 2020-02-10 15:27:07 -05:00
parent cd7ee8d505
commit 40d31a57c9
4 changed files with 43 additions and 24 deletions

View file

@ -5,6 +5,12 @@ language: cpp
git: git:
submodules: false submodules: false
jobs:
include:
- os: osx
osx_image: xcode11.3
env: BUILD_SUIT=autotools
addons: addons:
apt: apt:
sources: sources:
@ -34,31 +40,21 @@ addons:
- gcc-9 - gcc-9
- g++-9 - g++-9
env:
- ''
- BUILD_SUIT=autotools
- CC=gcc-9 CXX=g++-9
- BUILD_SUIT=autotools CC=gcc-9 CXX=g++-9
install: install:
- sudo luarocks install busted > /dev/null - ./.travis/install.sh
- sudo luarocks install moonscript > /dev/null
- sudo luarocks install uuid > /dev/null
# Remove the CMake provided by travis
- sudo rm -rf /usr/local/cmake*
- if [ "$BUILD_SUIT" = "autotools" ]; then
sudo pip install -U cpp-coveralls;
git submodule --quiet init;
git submodule --quiet update vendor/googletest;
else
pushd /usr/src/googletest;
sudo cmake .;
sudo make install -j2;
popd;
fi
script: script:
- if [ "$BUILD_SUIT" = "autotools" ]; then - if [ $TRAVIS_OS_NAME = 'osx' ]; then
export PATH="/usr/local/opt/gettext/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:$PATH";
export CPPFLAGS="-I/usr/local/opt/gettext/include -I/usr/local/opt/icu4c/include";
export LDFLAGS="-L/usr/local/opt/gettext/lib -L/usr/local/opt/icu4c/lib";
export ACLOCAL_PATH="/usr/local/opt/gettext/share/aclocal"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig";
./autogen.sh;
./configure --enable-debug || cat config.log;
make -j2 || travis_terminate 1;
make test || travis_terminate 1;
elif [ "$BUILD_SUIT" = "autotools" ]; then
export CPPFLAGS="-fprofile-arcs -ftest-coverage"; export CPPFLAGS="-fprofile-arcs -ftest-coverage";
export LIBS="-lgcov"; export LIBS="-lgcov";
./autogen.sh; ./autogen.sh;

23
.travis/install.sh Executable file
View file

@ -0,0 +1,23 @@
#! /bin/bash
set -e
if [ $TRAVIS_OS_NAME = 'osx' ]; then
brew install autoconf ffmpeg freetype gettext ffms2 fftw fribidi libass m4 icu4c boost wxmac lua
else
sudo luarocks install busted > /dev/null
sudo luarocks install moonscript > /dev/null
sudo luarocks install uuid > /dev/null
# Remove the CMake provided by travis
sudo rm -rf /usr/local/cmake*
if [ "$BUILD_SUIT" = "autotools" ]; then
sudo pip install -U cpp-coveralls;
git submodule --quiet init;
git submodule --quiet update vendor/googletest;
else
pushd /usr/src/googletest;
sudo cmake .;
sudo make install -j2;
popd;
fi
fi

View file

@ -7,7 +7,7 @@ COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-au
ifeq (yes, $(BUILD_DARWIN)) ifeq (yes, $(BUILD_DARWIN))
CFLAGS += -mmacosx-version-min=10.8 -gfull CFLAGS += -mmacosx-version-min=10.8 -gfull
CXXFLAGS += -mmacosx-version-min=10.8 -gfull CXXFLAGS += -mmacosx-version-min=10.8 -gfull
LDFLAGS += -mmacosx-version-min=10.8 -Wl,-dead_strip -pagezero_size 10000 -image_base 100000000 LDFLAGS += -mmacosx-version-min=10.8 -Wl,-dead_strip
LIB_SHARED_LINK = $(LIB_SHARED_LINK_OSX) LIB_SHARED_LINK = $(LIB_SHARED_LINK_OSX)
endif endif

View file

@ -305,7 +305,7 @@ ifeq (Darwin,$(TARGET_SYS))
TARGET_DYNXLDOPTS= TARGET_DYNXLDOPTS=
TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER)
ifeq (x64,$(TARGET_LJARCH)) ifeq (x64,$(TARGET_LJARCH))
TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000 XCFLAGS+= -DLUAJIT_ENABLE_GC64
TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000 TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000
endif endif
else else