travis: test both 1.7.x and 2.0.x version of libwebsockets

This commit is contained in:
Shuanglei Tao
2016-09-20 20:38:12 +08:00
parent 20c5341dab
commit b31676520c
2 changed files with 17 additions and 5 deletions

View File

@@ -2,16 +2,27 @@ language: c
os:
- linux
- osx
env:
- LIBWEBSOCKETS_VERSION=v1.7.9
- LIBWEBSOCKETS_VERSION=v2.0.3
sudo: required
dist: trusty
branches:
only:
- master
addons:
apt:
packages:
- cmake
- libjson-c-dev
- libssl-dev
install:
- echo $TRAVIS_OS_NAME
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -q; sudo apt-get install -y cmake libjson-c-dev libssl-dev; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then pushd /tmp; curl -sLo- https://github.com/warmcat/libwebsockets/archive/v2.0.2.tar.gz | tar xz; cd libwebsockets-2.0.2; cmake .; make && sudo make install; popd; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew unlink cmake json-c; brew install cmake openssl json-c libwebsockets; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew unlink cmake json-c; brew install cmake openssl json-c; fi
- echo "Compiling libwebsockets-$LIBWEBSOCKETS_VERSION from source..."
- pushd /tmp; curl -sLo- https://github.com/warmcat/libwebsockets/archive/$LIBWEBSOCKETS_VERSION.tar.gz | tar xz; cd libwebsockets-*; cmake .; make && sudo make install; popd
script:
- echo $TRAVIS_OS_NAME
- cmake --version
- mkdir build && cd build
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then cmake .. && make; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make; else cmake .. && make; fi

View File

@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <getopt.h>