Skip to content

Commit

Permalink
Merge pull request #469 from analogdevicesinc/rgetz-update-osx-builds
Browse files Browse the repository at this point in the history
Travis-CI: Update OSX building to the same as Linux
  • Loading branch information
rgetz authored Apr 30, 2020
2 parents 5cb9368 + 3fd6a12 commit 10662b2
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CI/travis/before_install_darwin
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

. CI/travis/lib.sh

brew_install_if_not_exists cmake doxygen libusb libxml2
brew_install_if_not_exists cmake doxygen libusb libxml2 ncurses cdk
30 changes: 25 additions & 5 deletions CI/travis/make_darwin
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,33 @@

if [ "x${COVERITY_SCAN_PROJECT_NAME}" != "x" ] ; then exit 0; fi


build_osx() {
FLAGS=$1
echo "### cmake ${FLAGS}"
cmake ${FLAGS} ..

echo "### make"
make

echo "### files are"
ls
}

cd $TRAVIS_BUILD_DIR/build
cmake -DOSX_PACKAGE=ON -DPYTHON_BINDINGS=ON ..
make
ls
build_osx "-DOSX_PACKAGE=ON -DPYTHON_BINDINGS=ON -DWITH_EXAMPLES=ON"

# do not do this in the function, it will not install twice.
if [ "$TRAVIS" = "true" ] ; then
echo "### Installing package as root"
sudo make install
echo "### Deleting install_manifest.txt (created as root)"
sudo rm ./install_manifest.txt
fi

cd $TRAVIS_BUILD_DIR/build_tar
cmake -DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON ..
make
build_osx "-DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON"
echo "### make package"
make package
echo "### files are"
ls
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ if(APPLE)
#full Single Unix Standard v3 (SUSv3) conformance (the Unix API)
add_definitions(-D_DARWIN_C_SOURCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-sign-compare")
if(DEFINED ENV{TRAVIS} AND DEFINED ENV{CI})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
endif()
endif()

include(CheckSymbolExists)
Expand Down
5 changes: 0 additions & 5 deletions examples/ad9361-iiostream.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@
#include <string.h>
#include <signal.h>
#include <stdio.h>

#ifdef __APPLE__
#include <iio/iio.h>
#else
#include <iio.h>
#endif

/* helper macros */
#define MHZ(x) ((long long)(x*1000000.0 + .5))
Expand Down
5 changes: 0 additions & 5 deletions examples/ad9371-iiostream.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
#include <string.h>
#include <signal.h>
#include <stdio.h>

#ifdef __APPLE__
#include <iio/iio.h>
#else
#include <iio.h>
#endif

/* helper macros */
#define MHZ(x) ((long long)(x*1000000.0 + .5))
Expand Down
5 changes: 0 additions & 5 deletions examples/adrv9009-iiostream.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
#include <string.h>
#include <signal.h>
#include <stdio.h>

#ifdef __APPLE__
#include <iio/iio.h>
#else
#include <iio.h>
#endif

/* helper macros */
#define MHZ(x) ((long long)(x*1000000.0 + .5))
Expand Down
5 changes: 0 additions & 5 deletions examples/dummy-iiostream.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,7 @@
#include <errno.h>
#include <getopt.h>
#include <inttypes.h>

#ifdef __APPLE__
#include <iio/iio.h>
#else
#include <iio.h>
#endif

#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

Expand Down
5 changes: 0 additions & 5 deletions examples/iio-monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@
#include <stdbool.h>
#include <unistd.h>
#include <string.h>

#ifdef __APPLE__
#include <iio/iio.h>
#else
#include <iio.h>
#endif

#ifdef _MSC_BUILD
#define inline __inline
Expand Down
5 changes: 5 additions & 0 deletions tests/iio_stresstest.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
#include <limits.h>
#include <sys/time.h>

#ifdef __APPLE__
/* Needed for sysctlbyname */
#include <sys/sysctl.h>
#endif

#include "iio_common.h"

#define MY_NAME "iio_stresstest"
Expand Down

0 comments on commit 10662b2

Please sign in to comment.